Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119229 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30474 invoked from network); 5 Jan 2023 14:54:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Jan 2023 14:54:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3D1E7180544 for ; Thu, 5 Jan 2023 06:54:04 -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=-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_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-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (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 ; Thu, 5 Jan 2023 06:54:03 -0800 (PST) Received: by mail-yb1-f170.google.com with SMTP id c124so40290048ybb.13 for ; Thu, 05 Jan 2023 06:54:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=td6lfcqxlS3ouXCltHWMQbEWzO3MAkNcmbHj3Q5uyk0=; b=LRsRZtQiU/i0ffb1/NOJ2xUrN65nF6UBTLcA/n6QyEdCS6Wx4yOHdQZK5vl3P0USZE 19wiyK2GRO3rtcAKUDkoantte7eCDNqMSpa2zcknPvlSyRxBudnQCXGwpg1/fzCh/x4C xaqIYbny+YDnzY4lxn/k3UelO/PLkdPXsDfKm+d8ukcSAXqjfsXe8EC+Wa7GQdEgH0bl KJDUYZtEPmvuXvSYKDk7uMgTjMUz+xNRR6fOu9LprQV+Gk+Ry9my3Bv+aEUvoHFUBgOS hypHP4DbaEnSN+ihtFGBV2rt4ojaeoui0atZY6JYiEbKKL6t3k828ymitM+hyqWG38rB so2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=td6lfcqxlS3ouXCltHWMQbEWzO3MAkNcmbHj3Q5uyk0=; b=3WQbtZmi7gn6ZOokJ/RBwDCj2munNNdXW01njGsBPcKVM6Zm6CBcASLLihkCe4KypK OKnprrbwOsOvpWSrWfg2rYmvu4GtYwlEzYwgv/tI05kQmf9uzAt5Qwr9HpusmzCev142 ss+j6xzBuvAh7xa27UTmttuEdYIT6W9Vpgh5WZoWWrH+K4ckdQrvxLthJoTEW7n2xr6h nFKiTd7pqImVbbI9m5FGX9sZZYgvOoc4LZEaMmcc7aIR6xTj9pz1utjuA1lJ3Ws7dhGt 0QHQXIvMu2fczIkiT+db/IJuF9KL3dsyuKoJwWUYv7rv2PHoXj5Nf95ab06WhSQ/b4p9 Wn2Q== X-Gm-Message-State: AFqh2kqrfgXQMhrxcX3UVrBlyOYtrcmCBDSSMCsmGpnAyXmiIQARnxv2 y8+1sjOLs5QaQBX+qShnW42aT5ndjjyF1RexNbNBJ2z8yaM= X-Google-Smtp-Source: AMrXdXtCUH+MoE40TJ20FqKn5B6onYyuPove9M85BI/yan8sivxUcpMj3qPYErj7m/johgROpjww5OegHdcTDlfiZG4= X-Received: by 2002:a25:d8d7:0:b0:762:c7bc:7fce with SMTP id p206-20020a25d8d7000000b00762c7bc7fcemr6503063ybg.532.1672930443324; Thu, 05 Jan 2023 06:54:03 -0800 (PST) MIME-Version: 1.0 References: <0854b030-c51c-4c1b-a7dd-22835a1e5da9@app.fastmail.com> <831b9906-dc0c-420c-b22f-8a0cc8a1ad64@app.fastmail.com> <454c5329-d5a3-5174-d09c-346b7d65435c@bastelstu.be> <8f9cf24c-ee77-4227-9b7c-31c631bf8a72@app.fastmail.com> <84647C1B-0F61-41E5-981D-B860BE1E53CB@gmail.com> <3d8561bd-fdb1-417a-836b-5146fca56185@app.fastmail.com> <845495d8-52da-4d2e-90ee-79c697d87f30@app.fastmail.com> In-Reply-To: <845495d8-52da-4d2e-90ee-79c697d87f30@app.fastmail.com> Date: Thu, 5 Jan 2023 15:53:50 +0100 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, with readonly From: landers.robert@gmail.com (Robert Landers) One quick question, Will changing the property of a protected/private set via reflection be allowed? Or will you have to do some shenanigans like you currently have to do with readonly? Robert Landers Software Engineer Utrecht NL On Wed, Jan 4, 2023 at 9:29 PM Larry Garfield wrot= e: > > On Wed, Dec 21, 2022, at 3:23 PM, Larry Garfield wrote: > > On Tue, Dec 13, 2022, at 11:03 AM, Claude Pache wrote: > >>> Le 13 d=C3=A9c. 2022 =C3=A0 16:34, Claude Pache a =C3=A9crit : > >>> > >>> > >>> Hi, > >>> > >>> As of today, the following declarations are rejected as syntax errors= : > >>> > >>> ```php > >>> class C { > >>> $a; > >>> int $b; > >>> } > >>> ``` > >>> > >>> while the following declarations are accepted with implicit `public` = visibility: > >>> > >>> ```php > >>> class C { > >>> static $c; > >>> readonly int $d; > >>> } > >>> ``` > >>> > >>> It would be reasonable to propose to allow to consistently omit the `= public` keyword. But allowing to omit it in some cases (including the most = controversial one: `protected(set)`) and not in other cases...? Because of = this inconsistency, people are incited to always write explicitly `public` = anyway. > >>> > >>> =E2=80=94Claude > >> > >> > >> However, I=E2=80=99m just realising that omitting `public` in declarat= ions like > >> `public $a` and `public int $b` is probably not a good idea, because i= t > >> is incompatible with constructor property promotion, as `function > >> __construct(public int $b) { }`, and `function __construct(int $b) { }= ` > >> have different meanings. > >> > >> =E2=80=94Claude > > > > Well, it seems the only people who have opinions on the abbreviated > > form at all dislike it, so we've removed it for now and left a mention > > in future-scope. A future RFC can add that if desired. > > > > That should, I think, be the final change to the asymmetric visibility > > RFC. Baring anything else coming up, I expect to call the vote > > sometime the week of 2 January. > > > > Happy $holiday! > > > > --Larry Garfield > > Happy New Year, PHP. Fair warning, I will be opening the vote for asymme= tric visibility on Friday, baring any sudden new inputs in the next 40-ish = hours. > > --Larry Garfield > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php >