Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130128 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 C5A161A00BC for ; Sun, 22 Feb 2026 18:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1771784099; bh=NGDKBKMfN1DE82mSAd4h84EbuRZdZeV7mtPxhJEHTLw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=T5Kckh/vxu7SUK9I96Y7o0AptAM7F0mnz/gkSE9sew/oTHxIeHoWawiW9IdSP1ne4 8CYp3Uu9nX14YwlxEbVcF3eumhcdu/DPSmjvY8rgGkdzfcuAIvyIQ6hCxiRXOv9a9Y WfL5avSRxSHfXCIt3ty/BWFYlW8dbNonSSvBvFVFNnJ13y5GVnf3Js2p56pOZBnasW BBQlAZYuG2EQs216rQMSN6UFbwbSjr4zas1F7eHu4xS003JwYUg7Y59gJfo+5Nq7/5 KM2NHsmXG+X83Lnpaqn3qXmPnD0n70k+V+OwrDSRvpACxE4tizgrHbRWvcic3tvxyo hXs8MXllr3L/A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B2417180050 for ; Sun, 22 Feb 2026 18:14: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.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 ; Sun, 22 Feb 2026 18:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1771784091; bh=8v+g3OHLBAuqe/TSIo9CyBg6poOwBttnXEzsUxnQ75M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=opJy+/gGM1C7xaHamhnH2aNdj5p5X5FdD6i7t7KOPoklysvEazprqyXQ//6CLghgp I20J5y0gwXvuY9wIYWTX+MEQdJEkqjw0cpEidWiK5DNoon9qU1eVBxRyzaJuspcat8 GJrinzvs8pn0Sf2jzkhJm14BQobDUpb7XfRqxfWJiD94hL6dHx4WJ0G1pJcI5NqLZL UFS+bfi0YINOKOMtGv9a6FzkHnUbhLotiUcXTXfXeXhdga12g8fft/6aMxywcD/JIR WzBysID7PH0vUnIKeYmtNRw//VX8c0yA8+soISsdtIQyYoI2sKcRgeEMCbWjITf3Mb MuGRDp/9QnFbA== Message-ID: <6def7a03-eba4-4289-ac4f-0881c5d4c092@bastelstu.be> Date: Sun, 22 Feb 2026 19:14:50 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Allow Reassignment of Promoted Readonly Properties in Constructor To: Nicolas Grekas Cc: PHP Internals List References: <4b74f9a1-96d2-4104-abdd-fe56c5e7016c@app.fastmail.com> <585bfc82-a522-43ec-be42-b8945952fe8b@app.fastmail.com> <3cd0d869-5a5b-467c-8eb4-3f8647ba7aa7@bastelstu.be> Content-Language: en-US In-Reply-To: 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 On 2/19/26 10:49, Nicolas Grekas wrote: > Thanks, I've added new test cases to cover this. > I've also improved tests as suggested on the PR. > And finally I updated the implementation to reuse IS_PROP_REINITABLE > instead of adding new flags + use an approach that doesn't require walking > the call stack. > PR and RFC updated accordingly, all green. Thank you. The implementation looks much simpler now and the tests all make sense to me and I can't think of any other relevant “edge case”. I have one more comment regarding the RFC text, which should result in “minor” changes as per the policy of making clarifying changes: 1. “Set in child before parent::__construct()” also fails, since the property slot is not yet initialized: That explanation and example does not seem to be quite correct: It's not the `$this->x = 'C';` assignment that fails, it's the implicit CPP assignment when calling parent::__construct(). The explanation should be fixed and the `// Error: Cannot modify readonly property P::$x` comment should be moved to the `parent::__construct()` call. The test in the implementation was already correct. Other than that, I don't have any further comments and I believe everything relevant is mentioned. Personally I'm likely to “Abstain” from the vote for the same reasons that Bob previously mentioned. Best regards Tim Düsterhus