On 4. 6. 2026 at 12:29:42, Ondřej Mirtes <[email protected]> wrote:

> ’d also like to point out a few places in currently shipping PHP version
> where you can put types in native syntax and they are not checked at
> runtime, meaning completely wrong and non-existent types are silently being
> accepted or skipped.
>

I just remembered one more place: attributes. They’re not validated until
something tries to newInstance them via reflection. Which might be never.
They can be invalid for all kinds of reasons - nonexistent class, class
that isn’t an attribute, targeting wrong target. Proof:
https://3v4l.org/Pmai6#v

Ondřej Mirtes

Reply via email to