Re: [RFC] Allow Reassignment of Promoted Readonly Properties in Constructor

From: Date: Mon, 09 Mar 2026 17:57:34 +0000
Subject: Re: [RFC] Allow Reassignment of Promoted Readonly Properties in Constructor
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-130281@lists.php.net to get a copy of this message
Le jeu. 22 janv. 2026 à 16:33, Nicolas Grekas <nicolas.grekas+php@gmail.com> a écrit : > Dear all, > > Here is a new RFC for you to consider: > https://wiki.php.net/rfc/promoted_readonly_constructor_reassign > > As a quick intro, my motivation for that RFC is that I find it quite > annoying that readonly properties play badly with CPP (constructor property > promotion). > > Doing simple processing of any argument before assigning it to a readonly > property forces opting out of CPP. > > This RFC would allow setting once a readonly property in the body of a > constructor after the property was previously (and implicitly) set using > CPP. > > This allows keeping property declarations in their compact form while > still enabling validation, normalization, or conditional initialization. > Friendly reminder about this RFC. It's been quiet for 13 days so I plan to start the vote on Thursday if there are no more concerns to the text of the proposal. Cheers, Nicolas

« previous php.internals (#130281) next »