Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130131 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 030421A00BC for ; Mon, 23 Feb 2026 07:49:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1771832990; bh=6+iRV8lVzEq8HFukXJUxGt5Vwg9nmRBEGlbZNP6mYek=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=apuOsQ0TxxLK6V4KrkJ5K3PclS9vOZmR2RaAUU3XjIKqOgwXrlj7M3UBIGhw4vQQr z+vSs4ONBpsCJX6lk8xKIg0L7v5oOGfWVB8MqXo++sXfXnEjfgUpPlMUe8BZTb3GEo PGCkJ0/GpCBuYbBiyjy3CUmJ5ho9fnTBmaAEpKGVSyH166oSJyflSMF5jIg2XqQRVB Bhuoe4gTBOVai7FYXS3LRBzlPl8oEh+Tg1OPkxfnajO03wSDV+9wSln36PYRsij3ex e8UIUglNIwYrWf+Iqe+yiMj758DEI6iagueehOcF8pLWIE140/+2ILMyNCVtGyxQxQ rVQ7MiMWon7XQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0567318006D for ; Mon, 23 Feb 2026 07:49:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 23 Feb 2026 07:49:49 +0000 (UTC) Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-89505dd3e24so53885796d6.1 for ; Sun, 22 Feb 2026 23:49:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771832984; cv=none; d=google.com; s=arc-20240605; b=SH+v/4AID3vjM5dsMA+Q5qpxeZVMJieNOXSck1bI/6rVnjuw0wmmdBs1MMfPVdVtZq iywFyX6nADYitjr9KMlfyL6iq4DkFvvRuWqChWUM2BnnAyGo9IFihQK3Ij7o+iRIlTTg TN2FqmKQabIkWAVAgb33ZvyAQcX5jjDzcZ396Ol3iV8y6LQDMBDfeLts58ZAQkhf+1fe MKEsfvhmdknrNqoTLKzzGOejFNtRrJdPJ3pSgWUzZd7kZOmsETdOJcmmPW8wXd8Uh93L ScNC9sWzIb/I4lnUGWIz1ov6iposalU+VajD2idX/wuEUBNeXN7GqirZ/W1gEO/1TEal lsrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=6+iRV8lVzEq8HFukXJUxGt5Vwg9nmRBEGlbZNP6mYek=; fh=Xr/ogOWGTRFA1d+q7p9CE+6uwwIHZm+lXGw7EES2NUs=; b=NmGE6k3l2oL7BIabdh/nTjtTFejjJHqVfZ16CM1Gl1d7N/3KDpczaCowgCa/Hf/O1z 5CIRZvukb9IgHYXVmg4+lVUaZOies5dHa+JgeYqQ/qvu67CrrG1kf0b6i7pz2de9D3sQ J1KE9K58CrB3I5DljaqYrKapdy+QJTP2hkGwljUVXgO+HXUz04iPDCRnPafzgunRGH+T 3RieFa0xfxGPnMq+gKyHAZSOTjn+vWqwMZNM8rbewW/ubDkNAZ1JasklXaxWVcB+XUpL MPew8hvBepezIybTuFxmbu/pHMXSSJqTEVTXOAboJiEuYTrphAyFCYjh3AQlJQeUhJ7x CiNA==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771832984; x=1772437784; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6+iRV8lVzEq8HFukXJUxGt5Vwg9nmRBEGlbZNP6mYek=; b=fdobSFS9YUjfjthi/pVMOrZcyBy6EC0xEKZ5Cb0+h9HmMl1NuFexqAl4qpkj3j4y/h 8Dq51BBTpSJhDiErpamB5z39lNe5Ms4i1RuSbSw235C6QhqYz6In+eUqhZbJLBwN8xxE n/bYhwBt0seba1iTkQa3ydZRKAgj/XsqlbcgbYY570bBZjA36iVb2ZTl4I2l4LUdi4Ov HT0n8woDD3LFzlIW+IpiBHWgmqh9+SstF/c6Db7OqAOscKbC7pdhZRY3bsqesXVuIdwD gGN+JOFb6L7bUKvo34ulV+yiyla9oLX7xcNu1+HePd7N07dAcoSRcvUxrspUB/6tICOe r2Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771832984; x=1772437784; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6+iRV8lVzEq8HFukXJUxGt5Vwg9nmRBEGlbZNP6mYek=; b=nnq5ez4AJn2MTHAdODHIh/5V+9fNvvxYzLprTZXUGo/yLbmJmxtW3hh4Wj18sJjmCa fP0c5yPfi+WHIf5rNSW0kI0wrKqpzh4ApiVpdqUyI00zReSC3Yv13P81oZpgEGd0Jyds p7g7tCzxvyYSmVlE2AGymn4IkbssurSIHqJURsGJuLGVIoKk53uMjCI8/X56rEzec7gw zZ8B6ZkEKchMGJDWWFAenjRZ4ixD1OJQlif/aXF5lO8fEqeuDK8wkaX5LtAW0Jk0N2hv xGZalmJCIMNRoyOvKT/UGwlQ+NwEec7BG4C+VYqizK9MIAqRwnSTFisjJZvQba4HYKRG hc6g== X-Gm-Message-State: AOJu0YzumDU190OjVVAd3Sz4OoINyKYu5VBmtUYvVQ6QjH86MvjJGm9T z2J/4QUAkakd7vgWkfmpNdxEQhkRqDdZ0vgnBIn1Vscqz+UGLoD/wN6tUpV5/j1PKa2DR4b21Ur TwN7qGwNAcQDXOVuKzcLggfALsJj9N6akV7U/ X-Gm-Gg: AZuq6aIbIuCo3XSBrIyS+wi+VPpOMS3u7GC6BKbhqd4+zOkPmWaYM3w5C9zOQ5C1OAy Xcon9p3SHh4sHshpugYJ+GOd9X3GjsF1s27tzuB0YjYf41lPbvOf4xoORZxuoEGqZPfLCozWDW7 kaAQlwFLtlAC4puMS0XYb8+FfzPiJa8VzyopWCNN98EVXxGLgxkblUxWG9ZwId+6d8k3Pu3H+oW WMXHaNAKtYF3qUPaN0GTw/0tb33AAs93AMRJBEZ6hdpOQYqtln3FcXyXrl9GLCEs22I++CuUi64 mJvwitHGpxSWW0dkL8fJXYsAKgvvRJp8/M92tMQK+vy3ZYI2N6gvzoIXyoBWd1T2WNg= X-Received: by 2002:a05:6214:29cb:b0:895:d629:5083 with SMTP id 6a1803df08f44-89979c910d5mr117981246d6.27.1771832983896; Sun, 22 Feb 2026 23:49:43 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <4b74f9a1-96d2-4104-abdd-fe56c5e7016c@app.fastmail.com> <585bfc82-a522-43ec-be42-b8945952fe8b@app.fastmail.com> <3cd0d869-5a5b-467c-8eb4-3f8647ba7aa7@bastelstu.be> <6def7a03-eba4-4289-ac4f-0881c5d4c092@bastelstu.be> In-Reply-To: <6def7a03-eba4-4289-ac4f-0881c5d4c092@bastelstu.be> Date: Mon, 23 Feb 2026 08:49:34 +0100 X-Gm-Features: AaiRm505K3oXiJg_ayvey_QU97V4JQGSt4U-T_7cLIVOiMtxgz2cM-sQcC1VFOY Message-ID: Subject: Re: [PHP-DEV] [RFC] Allow Reassignment of Promoted Readonly Properties in Constructor To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000009b45ef064b7903dc" From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --0000000000009b45ef064b7903dc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le dim. 22 f=C3=A9vr. 2026 =C3=A0 19:14, Tim D=C3=BCsterhus a =C3=A9crit : > Hi > > On 2/19/26 10:49, Nicolas Grekas wrote: > > Thanks, I've added new test cases to cover this. > > I've also improved tests as suggested on the PR. > > And finally I updated the implementation to reuse IS_PROP_REINITABLE > > instead of adding new flags + use an approach that doesn't require > walking > > the call stack. > > PR and RFC updated accordingly, all green. > > Thank you. The implementation looks much simpler now and the tests all > make sense to me and I can't think of any other relevant =E2=80=9Cedge ca= se=E2=80=9D. > > I have one more comment regarding the RFC text, which should result in > =E2=80=9Cminor=E2=80=9D changes as per the policy of making clarifying ch= anges: > > 1. =E2=80=9CSet in child before parent::__construct()=E2=80=9D also fails= , since the > property slot is not yet initialized: > > That explanation and example does not seem to be quite correct: It's not > the `$this->x =3D 'C';` assignment that fails, it's the implicit CPP > assignment when calling parent::__construct(). The explanation should be > fixed and the `// Error: Cannot modify readonly property P::$x` comment > should be moved to the `parent::__construct()` call. > > The test in the implementation was already correct. > > Hi Tim, Good catch thanks, wording updated! The RFC is ready then. Any other comments from anyone else? Nicolas --0000000000009b45ef064b7903dc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Le=C2=A0dim. 22= f=C3=A9vr. 2026 =C3=A0=C2=A019:14, Tim D=C3=BCsterhus <tim@bastelstu.be> a =C3=A9crit=C2=A0:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Hi

On 2/19/26 10:49, Nicolas Grekas wrote:
> Thanks, I've added new test cases to cover this.
> I've also improved tests as suggested on the PR.
> And finally I updated the implementation to reuse IS_PROP_REINITABLE > instead of adding new flags + use an approach that doesn't require= walking
> the call stack.
> PR and RFC updated accordingly, all green.

Thank you. The implementation looks much simpler now and the tests all
make sense to me and I can't think of any other relevant =E2=80=9Cedge = case=E2=80=9D.

I have one more comment regarding the RFC text, which should result in
=E2=80=9Cminor=E2=80=9D changes as per the policy of making clarifying chan= ges:

1. =E2=80=9CSet in child before parent::__construct()=E2=80=9D also fails, = since the
property slot is not yet initialized:

That explanation and example does not seem to be quite correct: It's no= t
the `$this->x =3D 'C';` assignment that fails, it's the impl= icit CPP
assignment when calling parent::__construct(). The explanation should be fixed and the `// Error: Cannot modify readonly property P::$x` comment should be moved to the `parent::__construct()` call.

The test in the implementation was already correct.


Hi Tim,

Good = catch thanks, wording updated!
The RFC is ready then. Any other c= omments from anyone else?

Nicolas=C2=A0
--0000000000009b45ef064b7903dc--