Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130177 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 6EE1B1A00BC for ; Thu, 26 Feb 2026 20:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772136313; bh=OurLBfFDFq2XMH3RZF3xdbGiT0DeEAjEWZVfSzQmW4g=; h=Date:From:To:In-Reply-To:References:Subject:From; b=j6/Wk4o0z8XXYA6nr3m4myub5K8JorjKWjRxg8IQApeUO3w8n4oKT9BifefW813Ab qI2EYB/tmeQDbdUJVad5sEMdv/DtExxYKjKn7PtPPEL5HhGB/i6jGZeiEe9qkClRY5 wzwduIgrBD+8TunpfJRgs3PKsN5ihOKCpCnM8sW3mzVLGXD9IFBPAe7vDC5Z7JBV21 NHyvqeQuYgIMlqS/X2xa8xcEW4GE4ZtQYEFeYrB6Jt9AD/Io+pv/VmciSrzXTR9UxZ Cn2UufCuhp+x1HooH/F/ess3Lf18fGZ+0ymbymTx7KumADtcTmXbChCsLOjs2AVuFB rtgkHtHh1dBlA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 408A51801D7 for ; Thu, 26 Feb 2026 20:05:10 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (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 ; Thu, 26 Feb 2026 20:05:09 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5F9691400058 for ; Thu, 26 Feb 2026 15:05:04 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Thu, 26 Feb 2026 15:05:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1772136304; x=1772222704; bh=MxdfWJYfFqnR5tFLyihNt guugzG7Joh5KpaVRg4m680=; b=KxvkOp/wDDqAJ23+w+dzcfSrhUnnxuKgQ2qKD fMI65kORlf0HPrEFtc8Kc79C4NpL70zODEjtRbaH+LbgNYDo2CnIdBL++r4vVxnf xcucMHpK/8jhar0E+IeB55zeNvMY/M8QiMFMmp0oWQUOEJHWgonS8XisDTpZshv6 JSz7fC/V79zLoxwubSKKXjaRtNNkvQv2Qs+Iq2NGyMSOXcBqYrNYqF7ky+X0JyBr smbkE+IfZXb6aUWGxtj92uM65ghw+oIgM9iffUwJRcrg/n3nUj8nSeZU6jjwNiOr cKYAvDrJmTqOdSfdPg8pWxmNUKlzFoVFaD2uLb1xaee8d5VBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1772136304; x=1772222704; bh=M xdfWJYfFqnR5tFLyihNtguugzG7Joh5KpaVRg4m680=; b=ILhU4UPjiPrW6K0k5 FbiI0FWdC5bfmvTLdm9v1GTV8H/T7mHv//xwIvVoKWmlgmJ9bs0TV27+Izs50CEd NAyy0fdex4lOePs3flZwWotC+kx2qxJLciT8llaMom6C4zXoBDeL1S4apjJs3vjm hdIAV173jexCIJ3Ai+T/WxeydyTLICYaTPVU74biK3hw4QRI/yWJI9Lk66U1YgOZ /MyhIBg8tYndGVMKLCI+UWEdj0gA9cJ47kcEFzQasw7yMz3ejNEzQv6JVQHk1VUb rKrALY5qS/LHQrpsbsCFHCIWDKvcBh72nqNkP3650vDAD8QFMt29HEkizuYZpi33 VRRuQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgeeileekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeeugfetieejueevffdulefhhfethfekvedtueevgfffvdef iedvtefgheevteelffenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghl ughtvggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 0F8B5700065; Thu, 26 Feb 2026 15:05:04 -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: ApWOO0YdA2Vg Date: Thu, 26 Feb 2026 14:04:41 -0600 To: "php internals" Message-ID: <8d16a1e3-7087-412a-a7ee-0ae7ff4b1d56@app.fastmail.com> In-Reply-To: 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> Subject: Re: [PHP-DEV] [RFC] Allow Reassignment of Promoted Readonly Properties in Constructor Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Tue, Feb 24, 2026, at 4:29 PM, Nicolas Grekas wrote: > Le mar. 24 f=C3=A9vr. 2026 =C3=A0 20:57, Larry Garfield a =C3=A9crit : >> On Tue, Feb 24, 2026, at 1:34 PM, Nicolas Grekas wrote: >>=20 >> >> Otherwise, I'm happy with where this ended up. Thanks! >> >>=20 >> > >> > Thanks for having a look! >> > Here is the update:=20 >> > https://wiki.php.net/rfc/promoted_readonly_constructor_reassign?do=3D= diff&rev2%5B0%5D=3D1771797005&rev2%5B1%5D=3D1771961558&difftype=3Dsideby= side >> > >> > Cheers, >> > Nicolas >>=20 >> > Property hooks cannot be combined with CPP, so properties must be d= eclared separately >>=20 >> This is untrue. The following code is legal: >>=20 >> class Point { >> public function __construct( >> public float $x =3D 0.0 { set =3D> abs($value); },=20 >> public float $y =3D 0.0 { set =3D> abs($value); }, >> ) {} >> } >>=20 >> The point about readonly is valid, and worth keeping, as is the "affe= cts all writes" question, but the code above is possible. >>=20 > > My bad, I should get used to them more :) > > https://wiki.php.net/rfc/promoted_readonly_constructor_reassign?do=3Dd= iff&rev2%5B0%5D=3D1771961558&rev2%5B1%5D=3D1771972141&difftype=3Dsidebys= ide Looks good now. Thanks. :-) --Larry Garfield