From: [EMAIL PROTECTED]
Operating system: FreeBSD 4.6
PHP version: 4.2.3
PHP Bug Type: Variables related
Bug description: unset fails under certain conditions
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 bug report at http://bugs.php.net/?id=20534&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20534&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20534&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20534&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20534&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20534&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20534&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20534&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20534&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20534&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20534&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20534&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20534&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20534&r=isapi