On Mar 11, 2012, at 10:25 AM, Daniel Brown wrote:

> On Sat, Mar 10, 2012 at 10:37, Tedd Sperling <tedd.sperl...@gmail.com> wrote:
>> As such, there are no "globals" in PHP other than SuperGlobals. As I said, 
>> if I'm wrong, please show me otherwise.
> 
>    A superglobal is predefined at run-time by the parser,
> environment, SAPI, etc. (_SERVER, _POST, _GET, _REQUEST, _ENV,
> _SESSION, _COOKIE), whereas a global can be defined at any time, and
> is available to the current instance.  All superglobals are globals,
> but not all globals are superglobals.
> 
> -- 
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/


Now I'm confused.

My understanding is that all variables defined within the main script are 
accessible within the main script because they are all within scope by 
definition.

Additionally, main script variables are not accessible out of scope (such as in 
a function) unless one uses $GLOBALS to retrieve those values.

That is the limit of my understanding of $GLOBALS.

As to placing an additional requirement (i.e., being predefined) on the 
definition as to what constitutes a SuperGlobal is outside my understanding. As 
such, I must defer to the PHP Manual, namely:

http://php.net/manual/en/language.variables.superglobals.php

This document clearly states that $GLOBALS is a SuperGlobal -- what am I not 
understanding here?

Cheers,

tedd

_____________________
tedd.sperl...@gmail.com
http://sperling.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to