Q. What will be the output of the following PHP code ?
Code:
<?php
const $k = 10;
switch($k)
{
case 10:
print "First";
break;
case 11:
print "Second";
break;
default:
print "Third";
}
?>
β
Correct Answer: (C)
Error
Explanation: Constants cannot be used in switch cases.