Source Code:
(back to article)
<?php $x = 10; $y = 20; function add() { global $x, $y; return $x + $y; } echo add(); // 30 echo $GLOBALS['x']; // 10 echo $GLOBALS['y']; // 20 ?>
Result:
Report an issue