Q.1
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";
}
?>
Q.2
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";
}
?>
Q.3
What will be the output of the following PHP code ?
<?php
$i = 5;
while (--$i > 0 && ++$i)
{   
    print $i;
}
?>
Q.4
What will be the output of the following PHP code ?
<?php
$i = 5;
while (--$i > 0 || ++$i)
{   
    print $i;
}
?>
Q.5
What will be the output of the following PHP code ?
<?php
$a = "hello";
if (strlen($a))
    print strlen($a);
else
    print "hi";
?>
Q.6
What will be the output of the following PHP code ?
<?php
$a = "1";
$b = "0";
if ((int)$a && $b) 
    print"hi";
else 
    print "hello";
?>
Q.7
What will be the output of the following PHP code ?
<?php
while()
{
    print "hi";
}
?>
Q.8
What will be the output of the following PHP code ?
<?php
do
{
    print "hi";
}
while(0);
print "hello";
?>
Q.9
What will be the output of the following PHP code ?
<?php
$b = 1;
switch($b)
{
case 1.0:
    print "hi";
    break;
case 1:
    print "hello";
    break;
default:
    print "hi1";
}
?>
Q.10
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";
}
?>
Q.11
What will be the output of the following PHP code ?
<?php
$b = 1;
switch(print $b)
{
case 2:
    print "hello";
    break;
case 1:
    print "hi";
    break;
default:
    print "hi1";
}
?>
Q.12
What will be the output of the following PHP code ?
<?phpspan>
$i = 0;
while(?++$i || --$i)
{   
    print $i;
}
?>
Q.13
What will be the output of the following PHP code ?
<?php
$a = "1";
switch ($a)
{
case 1:
    print "hi";
case 2:
    print "hello";
default:
    print "hi1";
}
?>
Q.14
What will be the output of the following PHP code ?
<?php
$a = "2";
switch ($a)
{
case 1:
    print "hi";
case 2:
    print "hello";
    break;
default:
    print "hi1";
}
?>
Q.15
What will be the output of the following PHP code ?
<?php
$i = 0
while ($i < 3)
{
    $i++;
}
print $i;
?>
Q.16
What will be the output of the following PHP code ?
<?php
$x = 1;
if ($x--)
    print "hi"
    $x--;
else
    print "hello"
?>
Q.17
What will be the output of the following PHP code ?
&lt?php
$a = "1";
switch($a)
{
case 1:
    break;
    print "hi";
case 2:
    print "hello";
    break;
default:
    print "hi1";
}
?>
Q.18
What will be the output of the following PHP code ?
<?php
$x = 1;
if ($x = $x& 0)
    print $x ;
else
    print "how are u";
?>
Q.19
What will be the output of the following PHP code ?
<?php
$x = 1;
if ($x = $x& 0)
    print $x;
else
    break;
?>
Q.20
What will be the output of the following PHP code ?
<?php
$x = 10;
$y = 5;
$z = 3;
if ($x / $y / $z)
    print "hi";
else
    print "hello";
?>
0 h : 0 m : 1 s