Hi, Daniil

> 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.

I think the default can be made final. This is because it is difficult to 
consider such complex "hack" operations as "features supported by the 
language." This is even considered a bug of some kind.

If more "realistic" code examples were available, the conclusion would be 
different.

At least, as far as I can currently understand, I don't think there is any need 
to consider backward compatibility with such "hacks".

Regards.

Saki
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to