go to bug id or search bugs for
When i did a var_dump($GLOBALS) i was surprized, because _SERVER variable was
missing here, but standalone _SERVER var was working fine.
According to http://www.php.net/manual/en/reserved.variables.globals.php,
"$GLOBALS is an associative array containing references to all variables which are
currently defined in the global scope of the script".
_SERVER is defined in global space. But it does not appear in the $GLOBALS.
I found nothing on php.net about such behaviour.
_SERVER key exists in $GLOBALS array.
_SERVER key does not exist in $GLOBALS array.
Add a Patch
Add a Pull Request
I also found that $_ENV and $_REQUEST vars are also missing in $GLOBALS.
_SERVER variable appears in $GLOBALS when using php in cli mode, but with web
server i can not find it in the $GLOBALS variable
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
super-globals (aka. auto globals) are not added to symbol tables by defaultfor performance reasons unless the parser sees need. i.e.
will list it. You can also control this using auto_gloals_jit in php.ini: http://www.php.net/manual/en/ini.core.php#ini.auto-globals-jit
Thanks for so fast response. I was near to blow my brain up.
Now i understand how it really works inside. Cool feature! :)