On Wed, Oct 18, 2023 at 2:26 PM Tim Düsterhus <t...@bastelstu.be> wrote: > > Hi > > On 10/17/23 19:06, Daniil Gentili wrote: > > 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. > >
Hello, > Perhaps make it two votes, each requiring a 2/3 majority? > > 1. Allow the 'final' keyword on anonymous classes? > 2. Enforce that all anonymous classes are final? How would someone make an anonymous class "unfinal"? I've used this "hack" in unit tests, many times. It's quite useful, so this would probably break a number of (at least my) unit tests if (2) were chosen. Robert Landers Software Engineer Utrecht NL -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php