Q.1
What will be the output of the following PHP code ?
<?php
$a = "$winner";
$b = "$looser";
echo $a, $b;
?>
Q.2
What will be the output of the following PHP code ?
<?php
$x = 5;
$y = 10;
function fun()
{
    $GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y'];
} 
fun();
echo $y;
?>
Q.3
What will be the output of the following PHP code ?
<?php
$a  =  '12345';
echo 'qwe{$a}rty';
?>
Q.4
What will be the output of the following PHP code ?
<?php
$a  =  '12345';
echo "qwe$arty";
?>
Q.5
PHP can automatically convert integers to floating point numbers and floating point numbers to integers.
Q.6
What will be the output of the following PHP code ?
<?php
$a  =  'a' ;
print $a * 2;
?>
Q.7
What will be the output of the following PHP code ?
<?php
$a  =  '4' ;
print  +  + $a;
?>
Q.8
What will be the output of the following PHP code ?
<?php
$x = 5;
function fun()
{
    $x = 10;
    echo "$x";
}
fun();
echo "$x";
?>
Q.9
What will be the output of the following PHP code ?
<?php
$x = 4;
$y = 3;
function fun($x = 3, $y = 4)
{
    $z = $x+$y/$y+$x;
    echo "$z";
} 
echo $x;
echo $y;
echo $z; 
fun($x, $y);
?>
Q.10
What will be the output of the following PHP code ?
<?php
$x;
echo "$x";
?>
Q.11
What will be the output of the following PHP code ?
<?php
$x = 5;
{
    $x = 10;
    echo "$x";
}
echo "$x";
?>
Q.12
What will be the output of the following PHP code ?
<?php
$i = 0;$j = 1;$k = 2;
print !(( +  + $i + $j) > ($j - $k));
?>
Q.13
In PHP the integer 45 is stored exactly as 45. The floating point number 46.3 could be stored as.
Q.14
What will be the output of the following PHP code ?
<?php
$a  =  '12345';
print "qwe{$a}rty";
?>
Q.15
What will be the output of the following PHP code ?
<?php
$x =4;
$y = 3;
function fun($x, $y)
{
    $z = $x + $y / $y + $x;
    echo "$z";
}
echo $x;
echo $y;
echo $z; 
fun(3, 4);
?>
Q.16
What will be the output of the following PHP code ?
<?php
function fun($x,$y)
{
    $x = 4;
    $y = 3;
    $z = $x + $y / $y + $x;
    echo "$z";
}
fun(3, 4); 
?>
Q.17
What will be the output of the following PHP code ?
<?php
$x = 5;
{
    echo "$x";
}
?>
Q.18
What will be the output of the following PHP code ?
<?php
$color = "red";
echo "$color";
echo "$COLOR";
echo "$Color";
?>
Q.19
What will be the output of the following PHP code ?
<?php
$x = 5;
function fun()
{
    echo "$x";
}
fun();
?>
Q.20
What will be the output of the following PHP code ?
<?php
$x = 3, 4, 5, 6;
echo "$x";
?>
Q.21
What will be the output of the following PHP code ?
<?php
$x = 5;
function fun()
{
    $x = 10;
    echo "$x";
}
fun();
echo "$x";
?>
Q.22
What will be the output of the following PHP code ?
<?php
$x = 10;
$y = 4;
$z = 3;
echo $x % $y % $z;
?>
Q.23
What will be the output of the following PHP code ?
<?php
$four4 = 4;
$three3 = 3;
$two2 = 2;
echo $four4 + $three3 / $two2 - 1;
?>
Q.24
What will be the output of the following PHP code ?
<?php
$4four = 4;
$3three = 3;
$2two = 2;
echo $4four + $3three / $2two - 1;
?>
Q.25
What will be the output of the following PHP code ?
<?php
class Constants
{
    define('MIN_VALUE', '0.0');  
    define('MAX_VALUE', '1.0');  
    public static function getMinValue()
    {
        return self::MIN_VALUE;
    }
    public static function getMaxValue()
    {
        return self::MAX_VALUE;
    }
}
echo Constants::getMinValue();
echo Constants::getMaxValue();
?>
Q.26
What will be the output of the following PHP code ?
<?php
define("__LINE__", "PHP is a scripting language");
echo __LINE__;
?>
Q.27
What will be the output of the following PHP code ?
<?php
one = 1;
two = 2;
three = 3;
four = 4;
echo "one / two + three / four";
?>
Q.28
What will be the output of the following PHP code ?
<?php
$on$e = 1;
$tw$o = 2;
$thre$e = 3;
$fou$r = 4;
echo "$on$e / $tw$o + $thre$e / $fou$r"; 
?>
Q.29
What will be the output of the following PHP code ?
<?php
$x = 10;
$y = 4;
$z = 3;
echo ($x % ($y) + $z);
?>
Q.30
What will be the output of the following PHP code ?
<?php
$x = 30;
$y = 20;
$z = 10;
echo $x + $y - $z / ($z - $y);
?>
0 h : 0 m : 1 s