How to handle a PHP switch with different types?
<p>How can I make the switch respect data types ( is there a workaround better then if/else ) ?</p>

<p><li>$value = false; // should echo false
<li>$value = null; // should echo null</p>

<pre>


switch ($value) {
    case '0' :
        echo 'zero';
        break;
    case '' :
        echo 'empty';
        break;
    case null :
        echo 'null';
        break;
    case false :
        echo 'false';
        break;
    default :
        echo 'default';
        break;
}

</pre>

<h1>Conclusion</h1>

<p><li>Switch/case does loose comparison.
<li>Solutions: switch with ifs or if/else</p>
