CSE :: PHP - CS
-
What will be the output of the following PHP code ?
<?php
function calc($num1, $num2)
{
$total = $num1 * $num2;
return $total;
}
$result = calc(42, 0);
echo $result;
?>
-
What will be the output of the following PHP code ?
<?php
$var = 10;
function one()
{
echo $var;
}
one();
?>
-
What will be the output of the following PHP code ?
<?php
function mine($m)
{
if ($m < 0)
echo "less than 0";
if ($ >= 0)
echo "Not True";
}
mine(0);
?>
-
What will be the output of the following PHP code ?
<?php
$x = 75;
$y = 25;
function addition()
{
$GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];
}
addition();
echo $z;
?>
-
What will be the output of the following PHP code ?
<?php
function 2myfunc()
{
echo "Hello World";
}
2myfunc();
?>
-
What will be the output of the following PHP code ?
<?php
function _func()
{
echo "Hello World";
}
_func();
?>
-
What will be the output of the following PHP code ?
<?php
function test($int)
{
if ($int == 1)
echo "This Works";
if ($int == 2)
echo "This Too Seems To Work";
}
test(1);
TEST(2);
?>
-
What will be the output of the following PHP code ?
<?php
function mine($num)
{
$num = 2 + $num;
echo $num;
}
mine(3);
?>
-
What will be the output of the following PHP code ?
<?php
function mine($num)
{
$num = 2 + $num;
echo "$num";
}
mine(3);
?>
-
What will be the output of the following PHP code ?
<?php
function movie($int)
{
$movies = array("Fight Club", "Kill Bill", "Pulp Fiction");
echo "You Do Not Talk About ". $movie[$integer];
}
movie(0);
?>