|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-02-24 10:12 UTC] derick@php.net
[2002-02-24 10:27 UTC] yohgaki@php.net
[2002-02-24 10:52 UTC] marekm at aptus dot pl
[2002-02-24 11:46 UTC] mfischer@php.net
[2002-02-24 12:04 UTC] nohn@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
I'm running the following script: $id=1; function test() { global $id; unset($id); } test(); echo($id); As the function test is being executed I think, the $id variable should be unset and so the script should output nothing, but it outputs 1. It IS possible to change the value od $id inside the 'test' function, it's just not possible to change the set/unset state. It's easy to omit the problem by unsetting $GLOBALS["id"] variable, but I think it should be possible to unset the global-ed variable in both ways. The problem affects all PHP 4.x versions. The 3.x versions work as I expect. Regards, Marek Matula