I've been thinking to much...
In the area of switch case is break;
required after die()
Example:
switch($i){
case 0:
die('Case without break;');
case 1:
die('Case with break;');
break;
}
die()
is just an alias for exit()
, where exit() will terminate the program flow immediately. (Shutdown functions and object destructors will still get executed after exit()
)
And no, it is not a syntax error to omit the break
, on the contrary there are many useful cases for omitting the break
. Check the manual page of the switch
statement for examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With