CSE :: PHP - CS
-
What will be the output of the following PHP code?
<?php
$op2 = "blabla";
function foo($op1)
{
echo $op1;
echo $op2;
}
foo("hello");
?>
-
What will be the output of the following PHP code?
<?php
function foo($msg)
{
echo "$msg";
}
$var1 = "foo";
$var1("will this work");
?>
-
What will be the output of the following PHP code?
<?php
echo ord ("hi");
?>
-
What will be the output of the following PHP code?
<?php
echo(atan(0.50));
?>
-
What will be the output of the following PHP code?
<?php
define("GREETING","Hello you! How are you today?");
echo constant("GREETING");
?>
-
What will be the output of the following PHP code?
<?php
function sum($num1, $num2)
{
$total = $num1 + $num2;
echo "chr($total)";
}
$var1 = "sum";
$var1(5, 44);
?>
-
What will be the output of the following PHP code?
<?php
function sum($num1, $num2)
{
$total = $num1 + $num2;
echo "cos($total)";
}
sum(5,-5);
?>
-
What will be the output of the following PHP code?
<?php
function b()
{
echo "b is executed";
}
function a()
{
b();
echo "a is executed";
b();
}
a();
?>
-
What will be the output of the following PHP code?
<?php
function addFunction($num1, $num2)
{
$sum = $num1 + $num2;
return $sum;
}
$return_value = addFunction(10, 20);
echo "Returned value from the function : $return_value"
?>