note 74516 added to language.variables.scope

From: Date: Sun, 15 Apr 2007 14:00:56 +0000
Subject: note 74516 added to language.variables.scope
Groups: php.notes 
Request: Send a blank email to php-notes+get-125418@lists.php.net to get a copy of this message
There's a problem with example 12.6. Each time the function is called, $a is set to zero, so it will always output zero, even though $a is static! <?php function Test() { static $a = 0; echo $a; $a++; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 70.17.37.84 ---- Manual Page -- http://www.php.net/manual/en/language.variables.scope.php Edit -- https://master.php.net/note/edit/74516 Del: integrated -- https://master.php.net/note/delete/74516/integrated Del: useless -- https://master.php.net/note/delete/74516/useless Del: bad code -- https://master.php.net/note/delete/74516/bad+code Del: spam -- https://master.php.net/note/delete/74516/spam Del: non-english -- https://master.php.net/note/delete/74516/non-english Del: in docs -- https://master.php.net/note/delete/74516/in+docs Del: other reasons-- https://master.php.net/note/delete/74516 Reject -- https://master.php.net/note/reject/74516 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#125418) next »