RSSAmplifier

Mountain Of Code · Apr 24, 2026

Crouching Exception, Hidden Type Coercion

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

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 ) {…

Read on /hidden-loose-type-checks

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.