7.4 arrived on 28 November with types on properties, and it introduces a state PHP has never had: a property that has been declared, has no default, and…
A child class overriding a method had to declare exactly the parent’s return type, so a factory interface could not promise that each implementation returns its own concrete…
array_column has worked on objects since 7.0, and it reads properties rather than calling getters — so it silently returns nothing for a well-encapsulated class. It does respect…
The return expression is evaluated before finally executes, but the value is not handed to the caller until afterwards — which means a finally that returns wins, silently.…
Implementing ArrayAccess so a class can be used with square brackets makes it look like an array to every reader and to no static analyser. The interface predates…
A closure has no serialisable representation in PHP, so any object holding one — a validator with a custom rule, a collection with a lazy callback — cannot…
An interface with every field optional describes what a response might contain and lets the compiler agree that a success field exists on an error. The narrowing is…