Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119000 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8118 invoked from network); 14 Nov 2022 07:04:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Nov 2022 07:04:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E01771804A9 for ; Sun, 13 Nov 2022 23:04:27 -0800 (PST) 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.6 required=5.0 tests=BAYES_50,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-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 ; Sun, 13 Nov 2022 23:04:27 -0800 (PST) Received: by mail-ej1-f50.google.com with SMTP id m22so25976382eji.10 for ; Sun, 13 Nov 2022 23:04:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6fCl2ufNKyrj5Db59cMa0UV2dCg5EUf6/DxPJ5N4BEU=; b=LZMt28DPSxwm9ZB8MtlR/3qWxJH33sxgR4SAE66MjOhO/YLGgbb9WkgjYiCjKR5rQg h2m1z2VEF7Qd1vf+TVhg2P0ZCVCsy5e5lWENIjziQ4ez/cMZHp/8p1ypA0VwhlNbD6tO fp/2RkL3oNK4egBXT8g6C5pwgFpyt87Re08ASlcxqEHaOBHJmrPY8PXVJUKwrFnwrXJI vRENZAwX5g7QVFTyZKDLfyJJlSFCfqRqFNiH+8eF5d7macT9adloaZxcwtgEcyWW77x5 6DpxDtfxwEDepcxJoMvMrQf+GVQuCkDl3JMxGiJfSukU0j/weKyVarHvPwNNqnAdvBqj Kvrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6fCl2ufNKyrj5Db59cMa0UV2dCg5EUf6/DxPJ5N4BEU=; b=hiycxh3ochqTlTT3fHQf/b1NcLhFzboYRJHB3+sncTYV666ML4FpR5/BLby+lJfXUV G2w6vF1sm6kPNZm8RTsQ+jHdj9DFNQorVAwiSX7omwhS5srUbioDeh3z2rivXxfl0DNG jNgaLM/ZaWecrE7qcjCh/vXkkQLBn/s0JVwlIz9ncPDBNeZd+uxWuyUeH2KbAYdPJdYs oINbmiYyz1Q6yZH6hcrW7LeDyC3aKmvA7cMeedU7PrWUUkpfiIAcokUrwzdUeOV3PS0s j0a+ySzyU4wdmAnsnVSAKH50LpQAVie6vRz/cTS4oeg2dzKD8FWZbPDFKcebCgkKKaY5 eiAA== X-Gm-Message-State: ANoB5plFjadZeYB/ui5zmvusXGfhHh64L4hqh4bMyhyOjLfkVfG/49pi c6s9X/SbxLQqV8ZJTaHPRTRRfizyCeE= X-Google-Smtp-Source: AA0mqf44foJ4ZL8wYabiKwI9lkfK9bj/fdlN8OlM0hMVCJ9OPzj61zhArxwfohBQbZ91BolkJgWpbQ== X-Received: by 2002:a17:906:806:b0:73d:7112:4601 with SMTP id e6-20020a170906080600b0073d71124601mr9195709ejd.239.1668409466029; Sun, 13 Nov 2022 23:04:26 -0800 (PST) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id 3-20020a170906328300b007aec1b39478sm3715229ejw.188.2022.11.13.23.04.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Nov 2022 23:04:25 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) In-Reply-To: <0854b030-c51c-4c1b-a7dd-22835a1e5da9@app.fastmail.com> Date: Mon, 14 Nov 2022 08:04:24 +0100 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <9AB678BC-ACF1-47F0-92A2-6F47AA1CEDBE@gmail.com> References: <0854b030-c51c-4c1b-a7dd-22835a1e5da9@app.fastmail.com> To: Larry Garfield X-Mailer: Apple Mail (2.3696.120.41.1.1) Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, with readonly From: claude.pache@gmail.com (Claude Pache) >=20 > public public(set) readonly string $foo >=20 > protected protected(set) readonly string $foo >=20 > These would be the only way to have a non-private-set readonly = property. While the first is in practice quite unlikely, the second has = valid use cases. =20 Both have use cases. Whether they are valid is quite subjective. (I am = speaking as someone who suffer from the `match()` construct forbidding = having both `default` and some other `case` pointing to the same = expression. That restriction seemed reasonable the time the feature was = designed and voted.) >=20 > 1. Relax the set-is-tighter restriction. That would allow `protected = protected(set)` etc. on any property. It wouldn't be particularly = useful unless readonly is being used, but it would be syntactically = legal and behave as you'd expect. We could still disallow "set is more = permissive" combinations (eg, `private public(set)`), as those have no = apparent use case. I think that Option 1 is the most reasonable. The meaning of `public = public(set)` and `protected protected(set)` is straightforward; from a = user point-of-view, disallowing them seems more like =E2=80=9Cit is = useless=E2=80=9D than =E2=80=9Cit is confusing=E2=80=9D. Unless there = are good technical reason to restrict it, we can just leave to linting = tools the care of reporting it. =E2=80=94Claude