note 99198 added to control-structures.switch

From: Date: Mon, 02 Aug 2010 19:20:26 +0000
Subject: note 99198 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-171340@lists.php.net to get a copy of this message
do you actually need to include a "break" statement if you call "return" inside a switch statement? switch($foo) { case 'bar': return true; break; // is this really necessary? case 'baz': return false; default: throw new Exception("neither bar nor baz"); } ---- Server IP: 69.147.83.197 Probable Submitter: 207.178.4.6 ---- Manual Page -- http://www.php.net/manual/en/control-structures.switch.php Edit -- https://master.php.net/note/edit/99198 Del: integrated -- https://master.php.net/note/delete/99198/integrated Del: useless -- https://master.php.net/note/delete/99198/useless Del: bad code -- https://master.php.net/note/delete/99198/bad+code Del: spam -- https://master.php.net/note/delete/99198/spam Del: non-english -- https://master.php.net/note/delete/99198/non-english Del: in docs -- https://master.php.net/note/delete/99198/in+docs Del: other reasons-- https://master.php.net/note/delete/99198 Reject -- https://master.php.net/note/reject/99198 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#171340) next »