ExamVeda
Login
Home
This question belongs to PHP Functions
Functions
?

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 & Solution
Correct Answer: Option A
z is a variable present within the $GLOBALS array, it is also accessible from outside the function!
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.