This page is a spot to list and discuss ideas for PHP 8. This is not a place to discuss features which may be accepted in the 7.X series; it is for features which require backwards compatibility breaks to achieve.
Here are some ideas that have backwards compatibility implications:
instanceof
to work with non-classes and add new functions for checking type and subtype relationships e.g. ($int instanceof int)
is_type_of(1, 'int')
is_subtype_of('array', 'iterable')
.true
return when isn't helpful for some functions and methods; see #75958.Here are some feature ideas:
mixed
. New types in the global namespace are technically reserved already but in practice it would have a small BC impact.