Re: questions about $_SERVER

From: Date: Fri, 09 Mar 2012 22:20:12 +0000
Subject: Re: questions about $_SERVER
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-316960@lists.php.net to get a copy of this message
On Mon, Feb 13, 2012 at 2:39 PM, Tedd Sperling <tedd.sperling@gmail.com> wrote: > On Feb 13, 2012, at 4:10 AM, Stuart Dallas wrote: >> On 13 Feb 2012, at 06:28, Rui Hu wrote: >>> How PHP sets variables in $_SERVER, say, $DOCUMENT_ROOT? What should I know >>> if I want to modify $_SERVER myself? >> >> Once your script starts the superglobals are no different to any other variables, except >> that they're in scope at all times. > > That's probably the reason why they are named "SuperGlobals". :-) > > But to be more descriptive, these are simply globals that are predefined by php -- see: > > http://php.net/manual/en/language.variables.superglobals.php > > I believe, (please show me otherwise) there are no "globals" in PHP other than > SuperGlobals. Assuming you mean pre-defined ones, there shouldn't be, since no other ones are documented. If there are, then either they should be documented, or they should be ignored as it can be dangerous to use undocumented features. :)

« previous php.general (#316960) next »