Discussion :: PHP - CS
-
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;
?>
Answer : Option A
Explanation :
z is a variable present within the $GLOBALS array, it is also accessible from outside the function!
Be The First To Comment