|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-11-07 18:29 UTC] jeroen@php.net
[2001-12-12 18:01 UTC] jan@php.net
[2020-02-07 06:12 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 14:00:01 2025 UTC |
Doing unset() on a static variable causes it to forget the fact that it is static for the rest of the function. e.g. <? function abc() { static $a = 123; echo "On entry, a = $a\n"; unset($a); $a = 456; } abc(); abc(); ?> should give 123 then 456. It gives 123 and 123. Replacing unset($a) with $a = null, or removing the unset() entirely has the desired result of giving 123 then 456.