Re: Final anonymous classes

From: Date: Fri, 05 May 2023 20:57:42 +0000
Subject: Re: Final anonymous classes
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-120201@lists.php.net to get a copy of this message
I am not sure about making them final by default. I think it's a more consistent language design to allow new final class() as you originally proposed. Although I don't know why anyone would want to extend anonymous classes, we can see that people do, in fact, do it. I don't see why we couldn't allow new class() extends $someClass in the future to specifically allow them to do this. I mean, I'm not going to lobby for it, I'm just pointing out that is more aligned and consistent with other parts of the language, than to simply make it final by default. Cheers.

« previous php.internals (#120201) next »