Is there anyway to make it so that the following code still uses a switch and returns b not a? Thanks!
$var = 0;
switch($var) {
Sorry, you cannot use a === comparison in a switch statement, since according to the switch() documentation:
Note that switch/case does loose comparison.
This means you'll have to come up with a workaround. From the loose comparisons table, you could make use of the fact that NULL == "0" is false by type casting:
Live Demo