PHP.nl

The ReturnTypeWillChange attribute

Laatst bijgewerkt:

The ReturnTypeWillChange attribute

Most non-final internal methods now require overriding methods to declare
a compatible return type, otherwise a deprecated notice is emitted during
inheritance validation.
In case the return type cannot be declared for an overriding method due to
PHP cross-version compatibility concerns,
a  attribute can be added to silence
the deprecation notice.

#[\ReturnTypeWillChange]

ReturnTypeWillChangeAttributes overview

Documentatie