note 71896 deleted from language.variables.scope by colder
| From: | colder@php.net | Date: | Thu, 21 Dec 2006 16:07:14 +0000 |
| Subject: | note 71896 deleted from language.variables.scope by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-120832@lists.php.net to get a copy of this message | ||
Note Submitter: test at thecodingtree punto com
----
I found, at least in PHP 5.1.1 (IIS v6) that the superglobal $GLOBAL is not so super if it is
definded within a function or class.
example:
<?PHP
function test(){
$GLOBAL['test'] = 'hello';
}
test();
echo $GLOBAL['test'];
?>
Output:
Notice: Undefined variable: GLOBAL in c:\XXXXXXX\XXXXXX\test\index.php on line 9
This may be obvious to some but I though when they said it was global it would be just that, global,
no matter what scope it was call in. This may be an issue only in IIS but still is troublesome.