Re: Super globals ?
| From: | Jasper Bryant-Greene | Date: | Sat, 20 Aug 2005 12:08:29 +0000 |
| Subject: | Re: Super globals ? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-221007@lists.php.net to get a copy of this message | ||
Kevin Waterson wrote:
This one time, at band camp, Jasper Bryant-Greene <jasper@bryant-greene.name> wrote:Exactly Kevin. What the OP wanted was to create another superglobal, just like $GLOBALS. The contents of $GLOBALS refer to the global variables, which are *not* all superglobals. The only superglobals by default in PHP (apart from $GLOBALS) are $_SERVER, $_GET, $_POST, and so on. He asked a question, and I provided the answer. Why he wants to do it is another question, but telling him to "use $GLOBALS" isn't answering his question, it's answering a different question, namely how to access the global variables. JasperBecause he asked for superglobals, not globals. $GLOBALS (not $_GLOBALS)meh, force of habithappens to be an example of a superglobal.and variable can be set within its scope, so why not use it? As we see in the manual at $GLOBALS _is_ a super global and available to all scopes within the script. http://www.php.net/manual/en/reserved.variables.php#reserved.variables.globals it refers to $GLOBALS as " This is a 'superglobal', or automatic global, variable. " gotta love the php manual