Operators and Expressions in php - PHP quiz 7

By CareerCadets

Operators and Expressions in php - PHP Online Quiz 7

Operators and Expressions in php - PHP quiz 7 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
$x = "test";
$y = "this";
$z = "also"; 
$x .= $y .= $z ;
echo $x;
echo $y;
?>

In PHP the integer 45 is stored exactly as 45. The floating point number 46.3 could be stored as.

What will be the output of the following PHP code ?

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

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;
?>

What will be the output of the following PHP code ?

<?php
$b = 1; $c = 4; $a = 5; 
$d = $b + $c == $a;
print $d;
?>

What will be the output of the following PHP code ?

<?php
static $x = 0;
function fun()
{
    echo $x;
    $x++;
}
fun();
fun();
fun();
?>

What will be the output of the following PHP code ?

<?php
$a  =  '12345';
echo 'qwe{$a}rty';
?>

What will be the output of the following PHP code ?

<?php
function fun()
{
    static $x = 0;
    echo $x;
    $x++;
}
fun();
fun();
fun();
?>

What will be the output of the following PHP code ?

<?php
$x = 1;
$y = 2;
if (++$x == $y++)
{
    echo "true ", $y, $x;
}
?>

What will be the output of the following PHP code ?

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

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

gmail WhatsApp Facebook Twitter Outlook Linkedin