?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$a = 97;
switch(?$a)
{
case "a":
print "hi";
break;
case 97:
print "hello";
break;
default:
print "hi1";
}
?>
<?php
$a = 97;
switch(?$a)
{
case "a":
print "hi";
break;
case 97:
print "hello";
break;
default:
print "hi1";
}
?>
Answer & Solution
Correct Answer:
Option
D
Downcasting does not happen in case,it compares only with its data type.
Join the Discussion
Login to post a comment or share your explanation.
Login