note 116436 rejected from control-structures.switch by salathe

From: Date: Sat, 03 Jan 2015 14:40:23 +0000
Subject: note 116436 rejected from control-structures.switch by salathe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-201350@lists.php.net to get a copy of this message
Note Submitter: fichorka at gmail dot com ---- Wouldn't it be simpler if "else" statement had the same effect as "default" case in switch statements? Like this: <?php $i = 6; switch ($i) { case 2: echo "i is 2"; case 3: echo "i is 3"; else: echo "wrong input or whatever. Enter number 2, or 3."; } ?>

« previous php.notes (#201350) next »