Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130434 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 70A0B1A00BC for ; Tue, 24 Mar 2026 18:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774378114; bh=8ytfXWx/rZ31qDZeZM75plxUMEf0bDL6SUxUXbjbI0c=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=WR8B0z1ckU8CeONg5v6ASI8wp1lhqeIV6pi/EmVxrpPMpzhyzPCL6m99+G0QQTMba L4y3JjjiPhKjSNDjVoTM1G9W66YHzJfHXhtYKwZfDBnhAJOaEJSJBHRuXl48JDP1Zz 1aKPm//bliOkf/bRoUx/FWPlNs9A9C1GWG1D0lfJTuoAPHHbQxJ1K7yiaNuhSl/bxj c9JmNIrAYn5GazfDdRXO61QyWrBM5BUkJOFcI0IucBxbRtEzoHGfFJ+37L03HszkBp OKyrDHVDD4VZaDAXIFGwNeuk+IseaxswZc+qfqoPEdO4W4HBQ14YQjsgjRegBQ1oY1 G12Bv67ty8Q+A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 361FD180037 for ; Tue, 24 Mar 2026 18:48:33 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b8-smtp.messagingengine.com (fhigh-b8-smtp.messagingengine.com [202.12.124.159]) (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, 24 Mar 2026 18:48:32 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 20A347A0141 for ; Tue, 24 Mar 2026 14:48:27 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Tue, 24 Mar 2026 14:48:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :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=fm1; t=1774378106; x=1774464506; bh=JTtpX/f/IBbK4Y1Kw6ECGDmLeWhdgL7PVxOPQHH+dz4=; b= IXSn8vsHC6I5U53UDSzsDRXLRU6wacKKUry0lm3zWFUKM7uAQjLF08IP9cNUZsoX kXLtlUhuxroHCWhR/4eOCtp6ZTrRBGNvXJ9nE8A6qkVrq/Hao6qDufu/m0CtfIkr p3Vmj1qRj0/YvwecOK5yVrPp8hqB2/Sr58nNTL+ThrAuIoFHZyHKt6h5jsjd+29k 3GT8Ed1pH5lE3YNKA0yk6kOx025Y6ONG3FSNQVL+bzG2LCnf2rwfbdh+jQJwbyJ4 ucm0fVIeqYWGr0HbT28OKn35VY5gYb07C+RZEns7f0sLtbsiqVi8DXtz4v0MKeD3 rpuy3AyVT9pxQT0IlMaTDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm1; t=1774378106; x= 1774464506; bh=JTtpX/f/IBbK4Y1Kw6ECGDmLeWhdgL7PVxOPQHH+dz4=; b=X bL0BOOX+wuSPJclBzjWW9bST6vKeH+0KDgqMXDxP2QI+x6t341MJbfuQbC43mqiR 4esHsXJts+ND/UA9/R5/aBOtMvolTOHCxr6rGDP2/NdYsMYR2iO7QbosKtjHFsCt EXr7cG7h4tDP4AddoF2yCjIMaYbcsTyaA2D3lj0bAgDNFNDMvUWPYXLVi+/TPp0G LCI6Nm0iw2wIc6o8COTcu7xlj2GltDGTer4PO/2zIe0h9WVkMsFSfZVof+UYcu62 8mPWTebDBZHemOWlZy5M2c6O1htvIHe8Rs0Vy2QFl0+tDRFyd4FCXpwzwKn5vI16 TcWHey7HDGDcWkH9geU/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvddvfeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevufgfjghfkfggtgfgsehtqhhmtddtreejnecuhfhrohhmpedftfhofigr nhcuvfhomhhmihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrd gtohdruhhkqeenucggtffrrghtthgvrhhnpeeugfejfefghfdvuddvieejhfeffeelueej ieehffdtgedtvdetuddufedukeeuueenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgs pghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrh hnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 24 Mar 2026 14:48:26 -0400 (EDT) Date: Tue, 24 Mar 2026 18:48:22 +0000 To: internals@lists.php.net CC: PHP Internals List Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_=5BVOTE=5D_Allow_Reassignment_of_?= =?US-ASCII?Q?Promoted_Readonly_Properties_in_Constructor?= User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <7EF2211A-0B32-4027-B2F3-4671AE244906@rwec.co.uk> Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 24 March 2026 14:06:53 GMT, "Micha=C5=82 Marcin Brzuchalski" wrote: >So while I understand the motivation behind the RFC, I think this moves >readonly further toward special-case behavior, when it would be better to >keep it strict and predictable=2E I agree with Ilija and Michal here=2E I can see why this might seem useful= , but the detailed rules feel very complicated, weakening the value of "rea= donly"=2E I think it also weakens the premise of CPP, which was to merge *three* pie= ces of code: the property declaration, the parameter declaration, and the a= ssignment=2E Perhaps what's actually needed is a variant that only merges the *assignme= nt* with the property declaration? That would then cover the case mentioned= in the RFC with a change in type, as well as the "readonly" case: ``` class Config { public function __construct( ?string $cacheDir =3D null, ) { public readonly string $this->cacheDir =3D $cacheDir ?? sys_get_te= mp_dir() =2E '/app_cache'; } } ``` I'm not sure I love it, but it feels more consistent with the intention of= both CPP and readonly=2E=20 Regards, Rowan Tommins [IMSoP]