PHP 4.0 Bug #5086: Global and unset will not unset the var
| From: | wico at cnh dot nl | Date: | Fri, 16 Jun 2000 15:57:36 +0000 |
| Subject: | PHP 4.0 Bug #5086: Global and unset will not unset the var | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21536@lists.php.net to get a copy of this message | ||
From: wico@cnh.nl
Operating system: linux
PHP version: 4.0 Release Candidate 2
PHP Bug Type: Scripting Engine problem
Bug description: Global and unset will not unset the var
<?
$a = "a";
$b = "b";
function Destroy_A () {
global $a; unset($a);
}
function Destroy_B () {
unset($GLOBALS[b]);
}
echo "Destroy_A_Before: ($a)<BR>";
Destroy_A();
echo "Destroy_A_After: ($a)<BR>";
echo "Destroy_B_Before: ($b)<BR>";
Destroy_B();
echo "Destroy_B_After: ($b)<BR>";
?>
output:
Destroy_A_Before: (a)
Destroy_A_After: (a)
Destroy_B_Before: (b)
Destroy_B_After: ()