Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121407 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94458 invoked from network); 18 Oct 2023 16:33:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Oct 2023 16:33:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 14C2418050B for ; Wed, 18 Oct 2023 09:33:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 18 Oct 2023 09:32:59 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 1BB5D32009F2 for ; Wed, 18 Oct 2023 12:32:58 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute1.internal (MEProxy); Wed, 18 Oct 2023 12:32:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1697646777; x=1697733177; bh=jVNufk5YxZ R0AY5BCENaSQdIIp7X1rB1r5mZTJNefd8=; b=rLBaiwDIszH4l8mkHm2TezLJfX Okg7Etazwjgb7ei54f7d7Hbin534nrXMHFgoRV2JwqU4EQQDRC5UXaLkIq5inb3l PWspYhtKXGkWl4y/MA8ihEq/HGzbxVu4VtAz0nINzmSplyOsQ8Vuifnliu2gwhjg 11dKJ8iB/hkiLRn6P9SgVtxySK7TFU3nHV8A5gZxYE8xNqhuwUVC0ap6w53RexeH 0ZLCt63HDtMojOJCMNhnF2SgM6fc7ZOycS0DW66U/q0ZpxfgyP824Ek1HZ2apib2 2Dk4a9s2JtLBN6iJvNYs1FQP6bAyHd7XvQkekXU9wCfZlRQ0TWxyXXSVCa8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1697646777; x= 1697733177; bh=jVNufk5YxZR0AY5BCENaSQdIIp7X1rB1r5mZTJNefd8=; b=b GL8p/iY3zAi8+3TlRnyUdyU6BwHf3GmlsBJsd0MP8MGI7MTTmv7AYsqYx+gLrrwU qnEKO56k28aylx8NpwZ6GX7+/7DZC5s4wV44TQ1ZCNBLLQLlXdGPvAd1mSGgwPVu RwsCZMl9YuSk2veeG1EYf2bFTXt0XjhdGY6mgbmg6ufXubTTaqJx9QsnlH1FOO8z 3BM1f1AwpZ9d4LBaMHWgSRp60AYDmM7q17+jXqW9qBgsdbqGbfJcd3O4sRqltZBQ kElAeyfaR3+Mn30B9j09tAtn6ufUZTMuuNfvOX91sLUyyEQ+L+PaGWQcxsO3fFMq +uV1ql2RNancYGzJrIzyA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeggdellecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeffffffjeffudfggeevvdeitdetvdfgjefffeffjeel feejteevheeghffhvdfgleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3DD971700089; Wed, 18 Oct 2023 12:32:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1019-ged83ad8595-fm-20231002.001-ged83ad85 MIME-Version: 1.0 Message-ID: In-Reply-To: References: Date: Wed, 18 Oct 2023 16:32:36 +0000 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Final anonymous classes From: larry@garfieldtech.com ("Larry Garfield") On Wed, Oct 18, 2023, at 12:35 PM, Robert Landers wrote: > On Wed, Oct 18, 2023 at 2:26=E2=80=AFPM Tim D=C3=BCsterhus wrote: >> >> Hi >> >> On 10/17/23 19:06, Daniil Gentili wrote: >> > Personally, I would have instead preferred the much cleaner approac= h of >> > making *all* anonymous classes final by default, (preferrably) with= out >> > offering the option to make them non-final. >> > >> > However, I understand that this might be a little bit too restricti= ve >> > 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. Making anon classes final by default would necessitate a new keyword to = de-final them; `open` comes to mind as that's what Kotlin uses for that = purpose, but there are other options to bikeshed. I... don't even know how to extend an anon class, honestly, so I'm prett= y sure the impact of going all the way would be small. I'm currently un= decided on which I prefer, but at least allowing them to be final sounds= reasonable. One thing I'm not sure about: What opcache optimizations would final ena= ble? =20 --Larry Garfield