note 128963 added to control-structures.switch

From: Date: Mon, 16 Oct 2023 12:16:59 +0000
Subject: note 128963 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-220922@lists.php.net to get a copy of this message
You can wrap up the case/break block with a curly braces: $x = 2; switch ($x) { case 2: { echo '2 entrypoint'; break; } default: { echo 'default entrypoint'; break; } } ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.157.134 (proxied: 188.232.152.237) ---- Manual Page -- https://php.net/manual/en/control-structures.switch.php Edit -- https://main.php.net/note/edit/128963 Del: integrated -- https://main.php.net/note/delete/128963/integrated Del: useless -- https://main.php.net/note/delete/128963/useless Del: bad code -- https://main.php.net/note/delete/128963/bad+code Del: spam -- https://main.php.net/note/delete/128963/spam Del: non-english -- https://main.php.net/note/delete/128963/non-english Del: in docs -- https://main.php.net/note/delete/128963/in+docs Del: other reasons-- https://main.php.net/note/delete/128963 Reject -- https://main.php.net/note/reject/128963 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#220922) next »