php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42582 get_defined_vars does not show _SERVER
Submitted: 2007-09-07 02:41 UTC Modified: 2007-09-07 08:44 UTC
From: thegreatall at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.4 OS: Windows XP Pro
Private report: No CVE-ID: None
 [2007-09-07 02:41 UTC] thegreatall at gmail dot com
Description:
------------
If I have code that does a simple print_r() on get_defined_vars() it should echo out all the variables defined including _SERVER, however it acts as if _SERVER does not even exist. If you put "$_SERVER;" anywhere in the script it will act correct.

I have also found this problem exists very similer to _ENV also.

Reproduce code:
---------------
<?php
print_r(get_defined_vars());
//$_SERVER; // uncomment this to see another result
?>

Expected result:
----------------
it should also show the _SERVER and _ENV vars, but it doesnt

Actual result:
--------------
does not display the _SERVER or _ENV vars.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-07 02:46 UTC] thegreatall at gmail dot com
Sorry I forgot to say that I had this problem while running it under IIS5 (ISAPI), I am not sure if it will reproduce the same in Apache; but it doesn't happen in the command line.
 [2007-09-07 08:44 UTC] jani@php.net
This is called "JIT". (look for auto_globals_jit in php.ini-dist for example..)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Dec 08 00:00:01 2025 UTC