|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-29 09:23 UTC] tony2001@php.net
[2004-07-29 09:44 UTC] kingoleg at mail dot ru
[2004-07-29 09:51 UTC] tony2001@php.net
[2004-07-29 10:04 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 21:00:02 2025 UTC |
Description: ------------ unset( $GLOBALS['foo']); unset only global variable, not variables that REFERED to global variable How we can unset global variable with all referenced variable using unset() function? Do we must user assign to null? Reproduce code: --------------- <?php function a( &$foo) { $foo = 'ok'; b( $foo); var_dump( $foo); } function b( &$foo) { $foo = 'not ok'; unset( $GLOBALS['foo']); } global $foo; $foo = 'global'; a($foo); var_dump( $foo); ?> Expected result: ---------------- NULL NULL Actual result: -------------- string(6) "not ok" NULL