问题描述
<?php$x = 75;$y = 25;function addition(){ $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];}addition();echo $z;?>
提示:
Notice: Undefined index: x in /www/admin/working.php.cn_80/wwwroot/compile.php(20) : eval()'d code on line 6Notice: Undefined index: y in /www/admin/working.php.cn_80/wwwroot/compile.php(20) : eval()'d code on line 6Notice: Undefined variable: z in /www/admin/working.php.cn_80/wwwroot/compile.php(20) : eval()'d code on line 9
问题解答
回答1:修改php.ini设置,将register_globals值设置为on。