note 20702 added to control-structures.switch

From: Date: Fri, 12 Apr 2002 22:52:15 +0000
Subject: note 20702 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-29182@lists.php.net to get a copy of this message
Proof that the test expression is evaluated only once at the beginning of the switch: $i = 1; switch ($i) { case ++$i: print "first"; case 2: print "second"; } This prints nothing. -- http://www.php.net/manual/en/control-structures.switch.php http://master.php.net/manage/user-notes.php?action=edit+20702 http://master.php.net/manage/user-notes.php?action=delete+20702 http://master.php.net/manage/user-notes.php?action=reject+20702

« previous php.notes (#29182) next »