?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
const $b = 1;
switch($b)
{
case 1:
print "hi";
break;
case 1:
print "hello";
break;
default:
print "hi1";
}
?>
<?php
const $b = 1;
switch($b)
{
case 1:
print "hi";
break;
case 1:
print "hello";
break;
default:
print "hi1";
}
?>
Answer & Solution
Correct Answer:
Option
A
Constants cannot be used in switch cases.
Join the Discussion
Login to post a comment or share your explanation.
Login