note 8351 added to unset
| From: | jon+php-dev at unequivocal dot co dot uk | Date: | Thu, 07 Sep 2000 14:54:08 +0000 |
| Subject: | note 8351 added to unset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4343@lists.php.net to get a copy of this message | ||
[note to editor: sorry, further clarification:]
It is actually even subtler than that. If you have a situation where before, you were doing:
global $foo;
unset($foo);
Then changing it to:
global $foo;
unset($GLOBALS['foo']);
will not unset the local $foo.
The correct fix is:
unset($GLOBALS['foo']);
global $foo;
or
global $foo;
unset($foo);
unset($GLOBALS['foo']);
http://www.php.net/manual/function.unset.php