Re: Final anonymous classes

From: Date: Tue, 25 Apr 2023 23:13:56 +0000
Subject: Re: Final anonymous classes
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-120132@lists.php.net to get a copy of this message
On 24-4-2023 12:28, Daniil Gentili wrote:
Hi all, I've submitted https://github.com/php/php-src/pull/11126 to add support for final anonymous classes, though as noted by iluuu1994, it would probably make more sense to just make all anonymous classes final by default, what do you think? Daniil Gentili.
I always though anonymous class where final by nature. The fact that that hack to extend them works, seems iffy at best. For what it's worth, I'd be in favour of making the default behaviour for anonymous classes final without the need to add a final keyword. For those edge-cases which would be broken by that change, I wonder if support to opt-out could be added via an #[AllowAliasing] attribute ?

« previous php.internals (#120132) next »