Q.1
What will be the output of the following PHP code ?
<?php
$x = 4;
$y = -3;
$z = 11;
echo 4 + $y * $z / $x;
?>
Q.2
What will be the output of the following PHP code ?
<?php
int $one = 1;
echo "$one";
?>
Q.3
What will be the output of the following PHP code ?
<?php
var $one = 1;
var $two = 2;
echo $one / $two * $one / $two * $two;
?>
Q.4
What will be the output of the following PHP code ?
<?php
define('IF', 42); 
echo "IF: ", IF;
?>
Q.5
What will be the output of the following PHP code ?
<?php
define("NEW_GOOD_NAME_CONSTANT", "I have a value");
define("OLD_BAD_NAME_CONSTANT", NEW_GOOD_NAME_CONSTANT);
 
echo NEW_GOOD_NAME_CONSTANT;
echo OLD_BAD_NAME_CONSTANT; 
?>
Q.6
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.7
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.8
What will be the output of the following PHP code ?
<?php
$x = 3.5;
$y = 2;
$z = 2;
echo $x / $y / $z;
?>
Q.9
What will be the output of the following PHP code ?
<?php
$hello = "Hello World";
$bye = "Bye";
echo $hello;"$bye";
?>
Q.10
What will be the output of the following PHP code ?
<?php
define("VAR_NAME","test"); 
${VAR_NAME} = "value"; 
echo VAR_NAME;
echo ${VAR_NAME}; 
?>
Q.11
What will be the output of the following PHP code ?
<?php
echo $red;
?>
Q.12
What will be the output of the following PHP code ?
<?php
print "echo hello world";
?>
Q.13
What will be the output of the following PHP code ?
<?php
$one = 1;
print($one);
print $one;
?>
Q.14
What will be the output of the following PHP code ?
<?php
class myObject { }
define('myObject::CONSTANT', 'test');
echo myObject::CONSTANT; 
?>
Q.15
What will be the output of the following PHP code ?
<?php
$x = 5;
$y = 10;
$z = "$x + $y";
echo "$z";
?>
Q.16
What will be the output of the following PHP code ?
<?php
$one = "one";
$two = "two";
print("$one$two");
?>
Q.17
What will be the output of the following PHP code ?
<?php
$one = "one";
$two = "two";
print($one==$two);
?>
Q.18
What will be the output of the following PHP code ?
<?php
$one = "Hello";
$two = "World";
echo $one, $two;
?>
Q.19
What will be the output of the following PHP code ?

<?php
$one = "Hello";
$two = "World";
echo "$one$two";
?>
Q.20
What will be the output of the following PHP code ?
<?php
$cars = array("Volvo", "BMW", "Toyota");
print $cars[2];
?>
Q.21
What will be the output of the following PHP code ?
<?php
$one = "one";
$two = "two";
print($one$two);
?>
Q.22
What will be the output of the following PHP code ?
<?php
$x = 4;
$y = 3;
$z = 1;
echo "$x = $x + $y + $z";
?>
Q.23
What will be the output of the following PHP code ?
<?php
$x = 4;
$y = 3
$z = 1;
$z = $z + $x + $y;
echo "$z";
?>
Q.24
What will be the output of the following PHP code ?
<?php
$one = "one";
$two = "one";
print($one == $two);
?>
Q.25
What will be the output of the following PHP code ?
<?php
print("this"."was"."a"."bad"."idea");
?>
Q.26
What will be the output of the following PHP code ?
<?php
define("GREETING", "PHP is a scripting language");
echo $GREETING;
?>
Q.27
What will be the output of the following PHP code ?

<?php
$one = "Hello";
$two = "World";
echo "$one"+"$two";
?>
Q.28
What will be the output of the following PHP code ?
<?php
echo "This is India";
?>
Q.29
What will be the output of the following PHP code ?
<?php
$one = "one";
$two = "two";
print($one,$two);
?>
Q.30
What will be the output of the following PHP code ?
<?php
$x = 3.3;
$y = 2;
echo $x % $y;
?>
0 h : 0 m : 1 s