adplus-dvertising
frame-decoration

Question

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;
?>

a.

100

b.

error

c.

75

d.

25

Posted under PHP

Answer: (a).100

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following PHP code ?

Similar Questions

Discover Related MCQs