Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121384 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40865 invoked from network); 18 Oct 2023 12:35:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Oct 2023 12:35:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0913C1804BC for ; Wed, 18 Oct 2023 05:35:41 -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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) (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 05:35:40 -0700 (PDT) Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-57f0f81b2aeso3730183eaf.3 for ; Wed, 18 Oct 2023 05:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697632540; x=1698237340; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aZ+FwCEuVJDo6YRnzIkMSNSL3CdwdVbnNOs8VxgcTlA=; b=IyyJs8yNxQw4NHZIzCxVKdOEBgfewftjU+3pDOasgv/tWEyrEzBjd9cfSDWGx5qFYA AJXVM6ueLOVrdIF/XVi4tHKWoHHkGZOaJcBsgcP6d5Lb0z+XD1bNVaiJcTFTIt9hT4ZJ 8I6nj+qGgcv2toSZcockbzW5G+HHE7w/WASWVqJYLyDsVLmSKT6+Q9kmbOyCyYHpP6x7 6ilVajfRounwqVnWen+i3HdwLuw5Sex3mOw3EblquJ+uLEbCzlKyWISBbE4eYtiwySGS DrM6XyxdvFeYXW0LdI/CbOl7gC+tqtmpaGWzABo8+lxZulF7PAbaujai7nONqYW3TdgB dBkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697632540; x=1698237340; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aZ+FwCEuVJDo6YRnzIkMSNSL3CdwdVbnNOs8VxgcTlA=; b=uHLVxVf7sXYIV2UB588L4noLdpqu7qrZb5FHCrSAjNGE3I9QVKhIr/BrOfoe1V+Ndm M7styuruEvoPY25dOYk/+ZLoIndaFchCKGM8aoVUwm4iilXYf4M2EHIrtzglusOaIR57 pAo52R2SG9eDU0UT/DnE/crueUf6zvWlkqctXiMQahpbzkCVlm/SN90gIbwyIDOWnmx/ lJOYCCpgIYCZ6XVs3Yw5uQ7WG4QtZsQqvvWHgzgaDSrpEW0bj8QyaRm1AAU0xfLUd2GH paRoEa947rnJhNvA77V9JBDrJkx/v/RY/bcVxrSVL9PtTL5zGEvZem9CU85BqYvYywt/ FrxQ== X-Gm-Message-State: AOJu0YweFHWbCYNXTWxfMaW79lKQiB86+LRZVvo5WdTvjgQq60voy0V0 PByJPzmSdQqzFNCT9WmEv7fjGvZNfoHpsHKth1Z1Ix/8ez4= X-Google-Smtp-Source: AGHT+IEPQPMfsQvn3xFX8IaFruyMFisdoKnYbloqyZUmemfzI76RzhDkpUaRFjfwnVETdgK/x938Ycqfx2vo0k+gltY= X-Received: by 2002:a05:6820:190f:b0:581:f6d8:5ca2 with SMTP id bk15-20020a056820190f00b00581f6d85ca2mr1917322oob.6.1697632539873; Wed, 18 Oct 2023 05:35:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 18 Oct 2023 14:35:28 +0200 Message-ID: To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: Daniil Gentili , internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Final anonymous classes From: landers.robert@gmail.com (Robert Landers) 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 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