Q.1
What will be the output of the following PHP code ?
<?php
$a = array("hi", "hello", "bye");
for (;count($a) < 5;) 
{
    if (count($a) == 3)
    print $a;               
}
?>
Q.2
What will be the output of the following PHP code ?
<?php
$user = array("Ashley", "Bale", "Shrek", "Blank");
for ($x=0; $x < count($user) - 1; $x++)
{
    if ($user[$x++] == "Shrek") 
    continue;
    printf ($user[$x]); 
}
?>
Q.3
What will be the output of the following PHP code ?
<?php
$user = array("Ashley", "Bale", "Shrek", "Blank");
for ($x = 0; $x < count($user); $x) 
{
    if ($user[$x++] == "Shrek") 
    continue;
    printf ($user[$x]); 
}
?>
Q.4
What will be the output of the following PHP code ?
<?php
for ($i = 0; $i % ++$i; $i++) 
{
    print"i";
}
?>
Q.5
What will be the output of the following PHP code ?
<?php
for ($i = 0; $i < 5; $i++) 
{
    for(; $i < 5; $i++)         
    print"i";
}
?>
Q.6
What will be the output of the following PHP code ?
<?php
$a = array("hi", "hello", "bye");
foreach ($a as $value) 
{
    if (count($a) == 2)
    print $value;         
}
?>
Q.7
What will be the output of the following PHP code ?
<?php
for ($count = 0; $count < 3;$count++);
{
    print "hi";continue;print "hello";
}
?>
Q.8
What will be the output of the following PHP code ?
<?php
for ($count = 0; $count<3;$count++);
{
    print "hi";break;print "hello";
}
?>
Q.9
What will be the output of the following PHP code ?
<?php
for ($i = 0; -5 ; $i++)
{
    print"i";
    if ($i == 3)
        break;
}
?>
Q.10
What will be the output of the following PHP code ?
<?php
for ($i = 0; 0; $i++) 
{
    print"i";
}
?>
Q.11
What will be the output of the following PHP code ?
<?php
for(++$i; ++$i; ++$i)
{
    print $i;
    if ($i == 4) 
        break;
}
?>
Q.12
What will be the output of the following PHP code ?
<?php
for ($i = 0;$i = -1;$i = 1)
{
    print $i;
    if ($i != 1) 
	break;
}
?>
Q.13
What will be the output of the following PHP code ?
<php
for ($i = 0; $i < 5; $i++) 
{
    for ($j = $i; $j > 0; $i--)
        print $i;
}
?>
Q.14
What will be the output of the following PHP code ?
<?php
for ($i = 0; $i < 5; $i++)  
{
    for ($j = $i;$j > $i; $i--)
        print $i;
}
?>
Q.15
What will be the output of the following PHP code ?
<?php
for(;;)
{
   print "10";
}
?>
Q.16
What will be the output of the following PHP code ?
<?php
$user = array("Ashley", "Bale", "Shrek", "Blank");
for ($x = 0; $x < count($user); $x++) 
{
    if ($user[$x] == "Shrek") 
	    continue;
    printf ($user[$x]); 
}
?>
Q.17
What will be the output of the following PHP code ?
<?php
for (1; $i == 1; $i = 2)
    print "In for loop ";
    print "After loopn";
?>
Q.18
What will be the output of the following PHP code ?

for ($i == 2; ++$i == $i; ++$i)
    print "In for loop ";
    print "After loopn";
?>
Q.19
What will be the output of the following PHP code ?
<?php
for ($x = 1; $x < 10; $x++)
    for ($y = 1; $y < 5; $y++)
        print "Hello";
?>
Q.20
What will be the output of the following PHP code ?
<?php
for ($x = 0; $x <= 10; print ++$x)
{
    print ++$x;
}
?>
0 h : 0 m : 1 s