PHP 4.0 Bug #7137: The unset function doesn't work inside a funcfion for a global var
| From: | laszloj at psi dot com | Date: | Wed, 11 Oct 2000 15:37:13 +0000 |
| Subject: | PHP 4.0 Bug #7137: The unset function doesn't work inside a funcfion for a global var | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-34677@lists.php.net to get a copy of this message | ||
From: laszloj@psi.com
Operating system:
PHP version: 4.0.2
PHP Bug Type: Variables related
Bug description: The unset function doesn't work inside a funcfion for a global var
<?
function xx() {
global $a;
unset($a);
}
// stage 1 - unset works
$a=1;
print "a= $a<br>";
unset($a);
print "a= $a<br>";
// stage 2 - unset doesn't work in function xx
$a=2;
print "a= $a<br>";
xx();
print "a= $a<br>";
?>
My Result page:
a= 1
a=
a= 2
a= 2 - it has to be empty because of previous unset
This script is working with PHP3.x
--
Edit Bug report at: http://bugs.php.net/?id=7137&edit=1