Final anonymous classes
| From: | Daniil Gentili | Date: | Tue, 17 Oct 2023 17:06:37 +0000 |
| Subject: | Final anonymous classes | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-121356@lists.php.net to get a copy of this message | ||
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.