3 ms·
switch($some_value) { case 1 : doSomething(); case 2 : doSomething(); break; case 3 : doSomethingElse(); break; default : doSometh
by 87159377 16y ago
switch($some_value) {
case 1 :
doSomething();
case 2 :
doSomething();
break;
case 3 :
doSomethingElse();
break;
default :
doSomething();
doSomethingElse();
}
Is there any reason why keeping things simple is not an option?
The number of possible outcomes in a switch case can often be so many that falling through would just be the route to complicated and difficult to manage code.