You cannot use mixed cases in a switch statement, as PHP will interpret the meaning of what you mean.
Under the conditions of a layman, he will try to find the "value" a ", which is not defined by the processor, and, therefore, in this case is 0.
The same goes for the code below:
<?php $x = "a"; switch($x) { case "c": echo "c"; break; case 1: echo "1"; break; case 0: echo "0"; break; case "a": echo "a"; break; case false: echo "false"; break; default: echo "def"; break; } ?>
Documentation is available on PHP.net.
source share