CSE :: PHP - CS
-
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;
?>
-
What will be the output of the following PHP code ?
<?php
$a = "$winner";
$b = "/$looser";
echo $a,$b;
?>
-
What will be the output of the following PHP code ?
<?php
$a = "$winner";
$b = "$looser";
echo $a, $b;
?>
-
What will be the output of the following PHP code ?
<?php
$a = "$winner";
$b = "$looser";
echo $a, $b;
?>
-
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;
?>
-
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
function fun()
{
$x = 0;
echo $x;
$x++;
}
fun();
fun();
fun();
?>
-
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
static $x = 0;
function fun()
{
echo $x;
$x++;
}
fun();
fun();
fun();
?>
-
What will be the output of the following PHP code ?
<?php
$x=0;
function fun()
{
echo $GLOBALS['x'];
$GLOBALS['x']++;
}
fun();
fun();
fun();
?>