Discussion :: PHP - CS
-
What will be the output of the following PHP code ?
<?php
function fun($x,$y)
{
$x = 4;
$y = 3;
$z = $x + $y / $y + $x;
echo "$z";
}
fun(3, 4);
?>
Answer : Option B
Explanation :
Value 3, 4 is passed to the function but that is lost because x and y are initialised to 4 and 3 inside the function. Therefore we get the given result.
Be The First To Comment