> Le 25 avr. 2023 à 15:46, Nicolas Grekas <nicolas.grekas+...@gmail.com> a
> écrit :
>
>
> Because they conceptually don't create a new type, I wonder if (final)
> anonymous classes could be allowed to extend final classes? In order to not
> allow hacking around and still create a type with class_alias(), we should
> forbid aliasing final anonymous classes IMHO. Then we could have this
> discussion about allowing finally anonymous classes to extend final
> classes. That'd be really useful in many situations where "final" is
> preventing end users from achieving what they want.
That would violate the very definition of `final`, which may be interpreted as
“final implementation” as much as “final type”?
If your goal is to have a proxy, I wonder whether it would be more appropriate
to design a proper way to define a proxy around an existing object, rather than
hacking around class inheritance?
—Claude
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php