#20534 [Opn->Bgs]: unset fails under certain conditions

From: Date: Thu, 21 Nov 2002 06:42:26 +0000
Subject: #20534 [Opn->Bgs]: unset fails under certain conditions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-25382@lists.php.net to get a copy of this message
ID: 20534 Updated by: derick@php.net Reported By: sputnik@reflexx.net -Status: Open +Status: Bogus Bug Type: Variables related Operating System: FreeBSD 4.6 PHP Version: 4.2.3 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2002-11-20 23:54:09] sputnik@reflexx.net global $myvar; unset ($myvar); // works. ------------------- // ($unsetvar was set to "foo" somewhere in the script, and is global global $unsetvar; echo $unsetvar; // => "foo" if($unsetvar == "foo") { echo "unsetting myvar"; global $myvar; unset($myvar); } // this will echo "unsetting myvar" but NOT unset the variable! // it seems the bug occurs when trying to use unset inside a structure that is doing some kind of test on a variable brought into global scope (even though the variable has the orrect value and the if statement succeeds!). It's not the if statement, because if(1) works. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20534&edit=1

« previous php.bugs (#25382) next »