Hi everyone,
I'd like to submit an RFC to add support for final anonymous classes.
This should also allow some additional opcache optimizations.
I've already prepared the implementation at
https://github.com/php/php-src/pull/11126, what do you think?
Personally, I would have instead preferred the much cleaner approach of
making *all* anonymous classes final by default, (preferrably) without
offering the option to make them non-final.
However, I understand that this might be a little bit too restrictive
for something that may have some valid usecases, even if extending
anonymous classes currently requires some hack-ish workarounds with
class_alias.
All in all, as per the title, I'd just like to add support for final
anonymous classes (new final class {}), without changing any existing
semantics.
What do you think?
Thanks,
Daniil Gentili.