Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129986 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 EF33C1A00BC for ; Tue, 3 Feb 2026 08:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1770108482; bh=oKkuLfHpzaNEgODTMn+FTdx0a1wmbzejCUdJiZKQbx8=; h=Date:From:Cc:In-Reply-To:References:Subject:From; b=O2hspp7bob8MnjaIhBt9S381+GeRoyqxHJssaM0hIFusEbKqINK9FAFf3wh62QtQa x59xewl4fR7ll1X779h3DOpUl5/vbm95ptOXbsttNfWZhUhkZH0LxPGjV1nVpQhI2l sGMjJsqBldvLAKVYqVnRRs2hnV31+rVg3Xub/7N8NTaXP4Kffp+NINv1rir1tVbTZs GylAGxAQa680iNln7dQaTtap1O+Ko8s6vsCfSrqJAOA4KwH+j/JTd1vg1u////14nM +vueaxs+p1RYSF9WHVkqTHmoRRA7mm/CIhd9eD6WDzypC/jo1Tb47nANt0J4EPxilE /RuJIfoSAo7Mw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8856A1804B8 for ; Tue, 3 Feb 2026 08:47:58 +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.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, MISSING_HEADERS,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (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 ; Tue, 3 Feb 2026 08:47:58 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id B94191D00095 for ; Tue, 3 Feb 2026 03:47:52 -0500 (EST) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-12.internal (MEProxy); Tue, 03 Feb 2026 03:47:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to; s=fm1; t=1770108472; x=1770194872; bh=oKkuLfHpzaNEgODTMn+FTdx0a1wmbzejCUdJiZKQbx8=; b=Qn6lkF5KZVCw 0FSS8Pwee1+3Tr2fXiBCSrW6OS2Q55U4h2MGFxrsuj/bBtQc67WANKbKPh5t+oTq XHkUDA+ewc9vx8ZkCrnmZDu6LomiXTtHigAPldobCl9IHtY6ZXQf/h1i1A2zDBg+ /Tcu+BNIEsNNHE1d7CMKKbUqSU35wcN584wN1Bd2gMPaLrAXSViOvGf3ESL2c4XI S55Y2SoZIxFyWsr33EuNDcqz66RO0fqtNrYm3kI4XdW0HYSvbKaRsWWxwoPfJBC0 Y9HWVjhhYqeP2luyus8C35leuwZ9X0sQNQJcvEocsDRMl+BbrkBFZsmURQRrs1tN QKttIUpzog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1770108472; x=1770194872; bh=oKkuLfHpzaNEgODTMn+FTdx0a1wmbzejCUd JiZKQbx8=; b=M/gAuI+hNDormfxm8mMJK7CdNaTs6n5YnDTErq9haeITAEohoZP N7pqRwZeMqwPVJXKRe+EunC9IooplLo3YePbP8IVUgzSaUYP7imrY5EBg1FtZLbC 97T8bW6/EAbUwpb20cUs5Ze9x2sdA+IlElOdXBDHJqLi1R7e/j7eFksmvXwMh1VV azhMC2lmbYr0uKlU580E8w/dWLSHdxwM0Qxl0aUTs2vy7QzMYnY8I2/Npcfaun0R CMkObYjh3RaUitg5xAdsUAsI5vBHTUFSukeHzfth5aFujFZ+N0Ik44ayKq8In2Xs gZDsDQSfEwRrvJ5Lo/mwgOSpGfRJNbziv0A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddujeelleeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnehmih hsshhinhhgucfvqfcufhhivghlugculdeftddmnecujfgurhepofggfffhvefkjghfufgt segrtderreertdejnecuhfhrohhmpedftfhosgcunfgrnhguvghrshdfuceorhhosgessg hothhtlhgvugdrtghouggvsheqnecuggftrfgrthhtvghrnhepgfffueeuueejvdegieeg hfdtiedtudefuefhtedtveehjeeifeejgeektdfgvefgnecuffhomhgrihhnpehphhhprd hnvghtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep rhhosgessghothhtlhgvugdrtghouggvshdpnhgspghrtghpthhtohepuddpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdr nhgvth X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 2FCCE182007E; Tue, 3 Feb 2026 03:47:52 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AZ7fesbM8yI- Date: Tue, 03 Feb 2026 09:47:31 +0100 Cc: "PHP Internals List" Message-ID: <4b74f9a1-96d2-4104-abdd-fe56c5e7016c@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Allow Reassignment of Promoted Readonly Properties in Constructor Content-Type: multipart/alternative; boundary=cda4c59cbc5240ac8f3d285a7a2314dd From: rob@bottled.codes ("Rob Landers") --cda4c59cbc5240ac8f3d285a7a2314dd Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Feb 2, 2026, at 22:14, Nicolas Grekas wrote: > Hi Marco, >=20 > Le lun. 2 f=C3=A9vr. 2026 =C3=A0 11:54, Marco Pivetta a =C3=A9crit : >> Hey Nicolas, >>=20 >>=20 >> On Thu, 22 Jan 2026 at 16:34, Nicolas Grekas > wrote: >>> Dear all, >>>=20 >>> Here is a new RFC for you to consider: >>> https://wiki.php.net/rfc/promoted_readonly_constructor_reassign >>=20 >>=20 >> What happens if one calls `$obj->__construct(1, 2, 3)` (on an already= instantiated `$obj`) in the context of this patch? >=20 > Thanks for asking, I didn't think about this. This made me also think = about ReflectionClass::newInstanceWithoutConstructor(). > I clarified this in the RFC, see "Direct __construct() Calls Cannot By= pass Readonly" and "Reflection: Objects Created Without Constructor". > Patch and PR updated also if anyone wants to run some code where this = RFC can be played with. >=20 > Cheers, > Nicolas Hi Nicolas, Under "Child Classes Can Reassign Parent Properties": this feels like a = major footgun. Calling parent::__construct() won't allow a reset (per th= e rules of calling a constructor directly); which would completely break= inheritance... but then in the examples it says that calling a construc= tor directly can reset it -- but you can't? This feels really inconsistent to me. =E2=80=94 Rob --cda4c59cbc5240ac8f3d285a7a2314dd Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Mon, Feb = 2, 2026, at 22:14, Nicolas Grekas wrote:
Hi Marco,

Le lun. 2 f=C3=A9vr. 2026 =C3=A0=  11:54, Marco Pivetta <ocr= amius@gmail.com> a =C3=A9crit :

<= /blockquote>

Thanks for asking, I didn't think about = this. This made me also think about ReflectionClass::newInstanceWithoutC= onstructor().
I clarified this in the RFC, see "Direct __const= ruct() Calls Cannot Bypass Readonly" and "Reflection: Objects Created Wi= thout Constructor".
Patch and PR updated also if anyone wants = to run some code where this RFC can be played with.

=
Cheers,
Nicolas