PHP Wishlist: Typing
PHP is a loosely typed language. It doesn’t care what types you throw around. Unless you want it to care.
The language has come a long way in the last several years to bring in a robust type system, allowing developers to enforce types in both function parameters and what a function’s return value is.
For everything else, there’s docblocks, ugly sanitisation and assertion code, and crossing your fingers to hope your function’s API holds up in practice.