ExamVeda
Login
Home
Operators and Expressions in php
?

What will be the output of the following PHP code ?
<?php
$x = 5;
$y = 10;
function fun()
{
    $y = $GLOBALS['x'] + $GLOBALS['y'];
} 
fun();
echo $y;
?>

Answer & Solution
Correct Answer: Option B
The value of global variable y does not change therefore it’ll print 10;
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.