|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-11-21 00:42 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 18:00:01 2025 UTC |
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.