ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?php
$a = "1";
$a = 1;
$b = 1;
switch($a)
{
case $a * $b: 
    print "hi";
    break;
case $a / $b:
    print "hello";
    break;
default:
    print "hi1";
}
?>

Answer & Solution
Correct Answer: Option B
It checks the first case, when it finds it equal it will perform it breaks out.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.