note 116448 added to control-structures.switch

From: Date: Mon, 05 Jan 2015 11:27:42 +0000
Subject: note 116448 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-201362@lists.php.net to get a copy of this message
Please note that PHP won't throw any error/warning if your switch utilizes more than one default - in such case it will just jump to the first one. Also note that you (for unknown reason for me) are allowed to use semicolons ; along colon : for case and default entries: <?php switch($foo) { case 0: // colon ... break; case 1; // semicolon is fine ... break; } ---- Server IP: 72.52.91.14 Probable Submitter: 213.155.167.238 ---- Manual Page -- http://php.net/manual/en/control-structures.switch.php Edit -- https://master.php.net/note/edit/116448 Del: integrated -- https://master.php.net/note/delete/116448/integrated Del: useless -- https://master.php.net/note/delete/116448/useless Del: bad code -- https://master.php.net/note/delete/116448/bad+code Del: spam -- https://master.php.net/note/delete/116448/spam Del: non-english -- https://master.php.net/note/delete/116448/non-english Del: in docs -- https://master.php.net/note/delete/116448/in+docs Del: other reasons-- https://master.php.net/note/delete/116448 Reject -- https://master.php.net/note/reject/116448 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201362) next »