Đ Đinh Yến New member Sep 20, 2021 #1 What will be the output of the following PHP code? Code: <?php $b = 1; switch($b) { case 1.0: print "hi"; break; case 1: print "hello"; break; default: print "hi1"; } ?> A. hihellohi1 B. hi C. hihello D. hello
What will be the output of the following PHP code? Code: <?php $b = 1; switch($b) { case 1.0: print "hi"; break; case 1: print "hello"; break; default: print "hi1"; } ?> A. hihellohi1 B. hi C. hihello D. hello
N Nguyễn Thị Lan New member Sep 20, 2021 #2 Answer: a Explanation: Upcasting does happen in case, it compares it with 1.0 and thus prints hi and exits. Upvote 0 Downvote
Answer: a Explanation: Upcasting does happen in case, it compares it with 1.0 and thus prints hi and exits.