Operators and Expressions in php - PHP quiz 5

By CareerCadets

Operators and Expressions in php - PHP Online Quiz 5

Operators and Expressions in php - PHP quiz 5 is a free online quiz challenge under Operators and Expressions in php - PHP category. There are 40 free online quiz challenges available in PHP category


What will be the output of the following PHP code ?

<?php
$a = 1; $b = 3;
$d = $a++ + ++$b;
echo $d;
?>

What will be the output of the following PHP code ?

<?php
$i = 0;
while (++$i && --$i)
{   
    print $i;
}
?>

What will be the output of the following PHP code ?

<?php
$i = "";
while ($i = 10)
{   
    print "hi";
}
print "hello";
?>

What will be the output of the following PHP code ?

<?php
$i = 2;
while (++$i)
{   
    while (--$i > 0)
        print $i;
}
?>

What will be the output of the following PHP code ?

<?php
$i = 0;
$j = 0;
if ($i &&  ($j = $i + 10)) 
{
    echo "true";
}
echo $j;
?>

What will be the output of the following PHP code ?

<?php
$var1 = 1;
echo $var1 = ++$var1 % 2 + ++$var1; 
?>

What will be the output of the following PHP code ?

<?php
$x = 0;
function fun()
{
    echo $GLOBALS['x'];
    $x++;
}
fun();
fun();
fun();
?>

What will be the output of the following PHP code ?

<?php
$y = 2;
if (--$y == 2 || $y xor --$y)
{
    echo $y;
}
?>

What will be the output of the following PHP code ?

<?php
$i = 0; $j = 1; $k = 2;
print !(($i + $k) < ($j - $k));
?>

What will be the output of the following PHP code ?

<?php
$var1 = 3;
print $var = ++$var;
?>

Invite your friends to Operators and Expressions in php - PHP quiz 5 Quiz

gmail WhatsApp Facebook Twitter Outlook Linkedin

Operators and Expressions in php - PHP quiz 5