Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118062 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55009 invoked from network); 22 Jun 2022 17:05:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jun 2022 17:05:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7E71B180545 for ; Wed, 22 Jun 2022 11:55:25 -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=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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, 22 Jun 2022 11:55:25 -0700 (PDT) Received: by mail-ed1-f48.google.com with SMTP id c65so2160605edf.4 for ; Wed, 22 Jun 2022 11:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TVLU29K+Io92/itn0nmot+/ptPdKCOSo2iMxdbm+wGw=; b=gpYjDNH2a/s4EhNZ8FbCIsosV0S1i7GTBEjHuhbcd1vZQaP8vU67o+BDtoSXBBSLnV IxTBaM/qLFED8JEOT7hQI0yzj9s3tGHK0NLxXcBVncW1FNXzY7V+PG5HLHL25I4adhNl 4suz3vHCIzWdmY0eCp79DmVO87rCamS+eNq2dVS4qH7QIJGd3w0yBNG1q7AZ355XYHpg KcVPjVU+PE1/aTkzc496JWjanUnFe+1evRxetUpBtFxB+dR1Dmoe3NvYVE54jKLhHyQX LrsaJRcrEYt6vxzbeNUPrewPCCLQG3JaufeRphaZ2bpCZV1tcB3rmxpJZ2Vxh6r+PIl6 blmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TVLU29K+Io92/itn0nmot+/ptPdKCOSo2iMxdbm+wGw=; b=OaMf9g/HqiTlBw2hwNziDKcB3mmhMr/3/Zqj1rQC00uvfF+xwi3yjtN0g83amA6Pt6 EG9Uh8d80F80+IP6JE04lKZcLPgGIA6Jd6ZU4kQ7R2kudkSawR1pmJfelqfnsrm5J322 Dli5VDytQrlKekDNa1NE0OxsEXv7eJIwfvvmU8mpNuO9AevPSj4p9g7OdTJMWHNEhCU8 kLbDmMcUcAgJ9MQt4vteqilwvzWAkXOLb790kP6nuaTpu/Z8dx/O4SMFwt2HOKL2d1UP VJxVzGdbd1GPABTnNHHd9CyX9AmPr+wEgAG/0bVdc0mkHEFtYmTCZkOabBvQHr2TvSl4 1OxQ== X-Gm-Message-State: AJIora/ol9AMlWTp+hQYluf+Sj2aTf9f0JzCZlnhrzT1PrddXe8o5zOp Qb7QslGCPoj7anOPHkhPcnM= X-Google-Smtp-Source: AGRyM1tefRdDJYLv8eRwIrkywQshZ+BWD0RK3QFnDwNvsNVXDGQuJMwGWL6I7BvgyvafOQX+tTWQXw== X-Received: by 2002:a05:6402:2816:b0:434:ed38:16f3 with SMTP id h22-20020a056402281600b00434ed3816f3mr5862147ede.116.1655924123977; Wed, 22 Jun 2022 11:55:23 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id lb3-20020a170907784300b00722e8827c53sm2414274ejc.208.2022.06.22.11.55.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2022 11:55:22 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) In-Reply-To: Date: Wed, 22 Jun 2022 20:55:22 +0200 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Ilija Tovilo X-Mailer: Apple Mail (2.3696.100.31) Subject: Re: [PHP-DEV] [RFC][Under discussion] Fetch properties in const expressions From: claude.pache@gmail.com (Claude Pache) > Le 17 juin 2022 =C3=A0 00:46, Ilija Tovilo a = =C3=A9crit : >=20 > (...) >=20 > Since the primary motivation of this RFC is to allow fetching the name > and value properties of enums I'm inclined to forbid using -> on > anything but enums. That would circumvent the issue since enums can't > contain user-defined properties nor the magic __get method, and > name/value are readonly. >=20 > I'll take a few days to think about the options, and will update the > RFC and inform the mailing list about the decision I have made. Let me > know if you have any more thoughts. >=20 Hi, I feel that, in any case, allowing unrestricted fetching properties in = const expression in is semantically incorrect, because properties are = fundamentally mutable. I am not speaking of creative use of code in = order to achieve the effect, but of the regular semantics of properties. For me, it seems reasonable to restrict the feature to readonly = properties (including those of enums), because those are effectively = immutable by design. =E2=80=94Claude