note 105292 deleted from language.exceptions by danbrown
| From: | danbrown@php.net | Date: | Mon, 08 Aug 2011 14:46:29 +0000 |
| Subject: | note 105292 deleted from language.exceptions by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182325@lists.php.net to get a copy of this message | ||
Note Submitter: thelordofcheese
----
>>fabian dot pijcke at gmail dot com
It's called scope. The context of a variable depends on whether it's defined in the
base of the document, inside a function, or inside a class.
There are three types of scopes: local, global and superglobal.
Superglobals exist at the server level. Globals exist at the document base level. Locals exist at
the function or class level for each instance of that function or class.
Scope can be set to global by using the 'global' keyword or using the $GLOBALS array when
defining the variable, and superglobals can be set using the reserved variable name ($GLOBALS is
itself a superglobal).
Then of course there's passing by reference...