Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121357 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40534 invoked from network); 17 Oct 2023 17:31:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Oct 2023 17:31:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2B56718050B for ; Tue, 17 Oct 2023 10:31:43 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS9370 160.16.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (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 ; Tue, 17 Oct 2023 10:31:42 -0700 (PDT) Received: from smtpclient.apple (softbank060067217005.bbtec.net [60.67.217.5]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id EA6A9401F9; Wed, 18 Oct 2023 02:31:39 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1697563899; bh=K0Qeaa59JOpve6GylynW/NSdBrzy54rxJD9P4Wq60aU=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=e3UXqehQ0o6mjOIAs/bLJr7YUI6yzDJg29hTIM68NJxzyuzXaI21WF9y1JvuafBn4 Pgpkj8MzJFR/VJ10h/hg26R1zdgnwQZm2jzE1k6SnFcxo9sbPgSQxAEiSfyezOZ8uQ 3RasygSHQ2PLNfT/KyEfqyZYH+5YVSpFhVO0jXag= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Wed, 18 Oct 2023 02:31:28 +0900 Message-ID: References: Cc: internals@lists.php.net In-Reply-To: To: Daniil Gentili X-Mailer: iPhone Mail (21A360) Subject: Re: [PHP-DEV] Final anonymous classes From: saki@sakiot.com (Saki Takamachi) Hi, Daniil > Personally, I would have instead preferred the much cleaner approach of ma= king *all* anonymous classes final by default, (preferrably) without offerin= g the option to make them non-final. >=20 > However, I understand that this might be a little bit too restrictive for s= omething that may have some valid usecases, even if extending anonymous clas= ses currently requires some hack-ish workarounds with class_alias. >=20 >=20 > All in all, as per the title, I'd just like to add support for final anony= mous classes (new final class {}), without changing any existing semantics. I think the default can be made final. This is because it is difficult to co= nsider 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 di= fferent. At least, as far as I can currently understand, I don't think there is any n= eed to consider backward compatibility with such "hacks". Regards. Saki=