Examveda
Examveda

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";
}
?>

A. hihellohi1

B. hi

C. hihello

D. hello

Answer: Option D

Solution(By Examveda Team)

Downcasting does not happen in case,it compares only with its data type.

This Question Belongs to PHP >> Control Structures(Loop In PHP)

Join The Discussion

Related Questions on Control Structures(Loop in PHP)