Embracing coercion in PHP
Paul Morris
Coercion is implicit typecasting for scalar types (integer, float, boolean and string). In this article we look at how we can use coercion as an elegant alternative to explicit typecasting. Coercing to integer We can coerce any expression to integer by suffixng |0 – bitwise or operator followed by...