Q. What will be the output of the following PHP code ?
Code:
<?php
$opt = "1";
switch($opt)
{
case 1:
break;
print "First Statement";
case 2:
print "Second Statement";
break;
default:
print "Third Statement";
}
?>
β
Correct Answer: (D)
Nothing
Explanation: As break is provided before print statement in case 1 it breaks the loop before printing.