Edit report at https://bugs.php.net/bug.php?id=65223&edit=1
ID: 65223
User updated by: truenrush at gmail dot com
Reported by: truenrush at gmail dot com
-Summary: $_SERVER variable missing in $GLOBALS
+Summary: $_SERVER, $_ENV, $_REQUEST variables missing in
$GLOBALS
Status: Open
Type: Bug
Package: *General Issues
Operating System: Debian
PHP Version: 5.4.17
Block user comment: N
Private report: N
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2013-07-09 10:40:30] truenrush at gmail dot com
Description:
------------
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.
Test script:
---------------
var_dump($GLOBALS);
Expected result:
----------------
_SERVER key exists in $GLOBALS array.
Actual result:
--------------
_SERVER key does not exist in $GLOBALS array.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65223&edit=1