Q.1
What will be the output of the following PHP code ?
<?php
$i = 5;
while (--$i > 0)
{   
    $i++;
    print $i;
    print "hello";
}
?>
Q.2
What will be the output of the following PHP code ?
<?php
$i = 0;
while (++$i && --$i)
{   
    print $i;
}
?>
Q.3
What will be the output of the following PHP code ?
<?php
$i = 0;
while ((--$i > ++$i) - 1)
{   
    print $i;
}
?>
Q.4
What will be the output of the following PHP code ?
<?php
$b = 1; $c = 4; $a = 5; 
$d = $b + $c == $a;
print $d;
?>
Q.5
What will be the output of the following PHP code ?
<?php
echo 5 * 9 / 3 + 9;
?>
Q.6
What will be the output of the following PHP code ?
<?php
$a = 1; $b = 3;
$d = $a++ + ++$b;
echo $d;
?>
Q.7
What will be the output of the following PHP code ?
<?php
$a = 1; $b = 1; $d = 1;
print ++$a + ++$a+$a++; print $a++ + ++$b; print ++$d + $d++ + $a++;
?>
Q.8
What will be the output of the following PHP code ?
<?php
$var1 = 1;
echo $var1 = ++$var1 % 2 + ++$var1; 
?>
Q.9
What will be the output of the following PHP code ?
<?php
$var1 = 1 + ++5;
echo $var1; 
?>
Q.10
What will be the output of the following PHP code ?
<?php
$var1 = 0;
$var1 = ($var1 + 5)++; 
echo $var1; 
?>
Q.11
What will be the output of the following PHP code ?
<?php
$a = 10; $b = 10;
if ($a = 5)
    $b--;
print $a;print $b--;
?>
Q.12
What will be the output of the following PHP code ?
<?php
$x = 5;
$y = 10;
function fun()
{
    $y = $GLOBALS['x'] + $GLOBALS['y'];
} 
fun();
echo $y;
?>
Q.13
What will be the output of the following PHP code ?
<?php
$a = 10;
$b = 4;
$c = fun(10,4);
function fun($a,$b)
{
    $b = 3;
    return $a - $b + $b - $a; 
}
echo $a;
echo $b;
echo $c;
?>
Q.14
What will be the output of the following PHP code ?
<?php
$i = 0;
$x = $i++; $y = ++$i;
print $x; print $y; 
?>
Q.15
What will be the output of the following PHP code ?
<?php
 $a = 5;$b = -7;$c =0; 
 $d = ++$a && ++$b || ++$c;
 print $d;print $a;
?>
Q.16
What will be the output of the following PHP code ?
<?php
function fun()
{
    $x = 0;
    echo $x;
    $x++;
}
fun();
fun();
fun();
?>
Q.17
In order to find if a variable holds an actual number or a string containing characters that can be translated into a number you can use:
Q.18
What will be the output of the following PHP code ?
<?php
$a = "$winner";
$b = "/$looser";
echo $a,$b;
?>
Q.19
What will be the output of the following PHP code ?
<?php
$a = "$winner";
$b = "$looser";
echo $a, $b;
?>
Q.20
What will be the output of the following PHP code ?
<?php
$a  =  '12345';
print "qwe".$a."rty";
?>
Q.21
What will be the output of the following PHP code ?
<?php
$i = 0;$j = 1;$k = 2;
print (( +  + $i + $j) >! ($j - $k));
?>
Q.22
What will be the output of the following PHP code ?
<?php
$a = 0x6db7;
print $a<<6;
?>
Q.23
What will be the output of the following PHP code ?
<?php
$var1 = 3;
print $var = ++$var;
?>
Q.24
What will be the output of the following PHP code ?
<?php
$i = 0; $j = 1; $k = 2;
print !(($i + $k) < ($j - $k));
?>
Q.25
What will be the output of the following PHP code ?
<?php
function fun()
{
    static $x = 0;
    echo $x;
    $x++;
}
fun();
fun();
fun();
?>
Q.26
What will be the output of the following PHP code ?
<?php
static $x = 0;
function fun()
{
    echo $x;
    $x++;
}
fun();
fun();
fun();
?>
Q.27
What will be the output of the following PHP code ?
<?php
$x=0;
function fun()
{
    echo $GLOBALS['x'];
    $GLOBALS['x']++;
}
fun();
fun();
fun();
?>
Q.28
The result of both the below expressions in PHP will be same:
1) 3+4*2
2) (3+4)*2
Q.29
Numbers in PHP can’t be infinitely large or small, there is some minimum and maximum size. If more larger (or smaller) numbers are needed then . . . . . must be used:
1. GPM libraries
2. GMP libraries
3. CBMath
4. BCMath
Q.30
Ceil(-2.1) would be
0 h : 0 m : 1 s