Crouching Exception, Hidden Type Coercion

I like to be as strict as possible when writing PHP, it helps avoid whole classes of bugs. This is achieved in PHP by doing two things: declare (strict_types=1) and type declarations wherever possible. This isn't a magic bullet. Even with 100% coverage there are type coercions and loose type checks hiding within in the PHP engine. Switch Statements <?php declare (strict_types=1); switch ( true ) {…