Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129861 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 434161A00BC for ; Thu, 22 Jan 2026 16:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769098869; bh=OK4BzdV/mHosCzsepDJdct23cGcRSE0GPmBAQZmU/mA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ehxvoaWMVA4AEPYY+Y4YDveNGDaCXXqlHu4J+ZBblk9I5Bds7PuwGJkRNdfM0nlCV VTSAgGEtaCbon38DoxZBPOBRqY4FOvgspOO983LZLSEl6/wy40IPgKaiVEK7SO6HRg XkIIEFEhprweq1K92dq+X1qDzPBzJcR3cow+wlXizVerFx1IZlzuGsHd01UygTCvZx ysGROhZs2cluRIkT/WtHBanMc7+9vf/cCKzCFye236XkKFeKqGFrUnZwCEYPE20TN3 3OEqU3CoinDf5lZZwsUA+dqxQHgvfpubkrArbkGDm/G47+e5t18QFkEbknCdC5pVDq vqItMsXVgWlrw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 162EE18062E for ; Thu, 22 Jan 2026 16:21:09 +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=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 22 Jan 2026 16:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1769098862; bh=0+3IhQUR4YoDFBLpEbf2OUVpEwjTo8yaSSiPbPesOmI=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=djvrwtFkkezQmSdN1TFvD1qDofnfuljWexuAOv3ChwsfzL7+epMOd1kFUBax/Hg0K 4u1kZivQg4C9A6MhF+6dr8O8cDBccMnrD/OfMfW8js1jx1GETWjDYlU3SlOv/KKPVD ED3yCOTRPYx6ucdWfib2a5Xwf+7OS1OL7tkiNq3WLlkxnWJ1JQfV49+DBCOAhd4HRF Rx3fPwZV76/ihKrnv1skENPuxq+LmeQLowlCWE0rE8qF6oR+lTEbEnC6CVPxwk+baR HwhF42ITeTeX1tKxKhSiZwF4Dd7LbFTdIynJdDTV6p9TnCVORFFQVPyLa/utYnnQJc aMn2VAyylsQ0w== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 22 Jan 2026 17:21:02 +0100 To: Nicolas Grekas Cc: PHP Internals List Subject: Re: [PHP-DEV] [RFC] Allow Reassignment of Promoted Readonly Properties in Constructor In-Reply-To: References: Message-ID: <077e27345a1f5b7969c114684aede7e8@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2026-01-22 16:33, schrieb Nicolas Grekas: > Here is a new RFC for you to consider: > https://wiki.php.net/rfc/promoted_readonly_constructor_reassign Thank you. I have taken a look and have the following notes (for now): 1. In the Problem Statement: “Option 2: Use default parameter expressions (limited):” The example seems incorrect to me, particularly the “// Cannot use $x in default expression for $x” comment doesn't make sense. Can you check you pasted in the correct snippet? 2. Within the proposal: “The reassignment must occur directly in the constructor body of the declaring class (not via method calls, closures, or other indirect means)” I believe this is inconsistent with `__clone()` where the readonly property remains unlocked until the end of `__clone()` (and is then locked). I'm seeing it is explained further below as “This restriction exists because the check verifies that the current executing function is the constructor of the declaring class. When a method or closure executes, the current function changes, even if it was called from the constructor”, which effectively means that you defined the semantics based on the implementation instead of the other way around, which I consider problematic from a language design PoV. I'm positive it is possible to find a better implementation here. 3. Within the “RFC Impact” section you removed the “Ecosystem” subsection from the template. I believe mentioning the ecosystem impact is relevant here. This change will likely require adjustments to static analysis tools and IDEs to not point out the now-valid assignment as an error. 4. As per the updated RFC policy. Please already include the (closed) voting doodle in the RFC so there is no ambiguity here. Don't forget to include the “Abstain” option. My suggested title would just be using the RFC title followed by a questionmark :-) And please add a link to the list archives to the References section (it's required per the policy and useful for future research). For your convenience, the correct link is this: https://news-web.php.net/php.internals/129851 Best regards Tim Düsterhus