Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127631 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 82B631A00BC for ; Mon, 9 Jun 2025 14:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1749480696; bh=Zh9P7Aiq1AD9Kfq0iGUb4ohkE9gJW+rT4t7T0d6am4w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OkOSOmHKNM61UX47UFjyujDQzcUFjLOVKYQk3Rhr120UWrQEIfUM64+7KfbDZrp3X 0oYNAwB0RrjwtYGfHfNk84pC9gxYVnMk2JGGC1k1aN1qBo42pRHjJSZj3XNh3VhrQY yBu+Shb8TGwBoRCQuAkHgEpnTvJ1PV8w2dnxZ8dlUK8ifPuQwzi499AWC7fW+SWmtH HcM+yZaWZKd34fhhPyireeZpAxbNTf50sLAMdMuiFCUtZp5VZBNjDvEtLzKkR2ljzM c/E9gn/kw2TjdAuIDjLT9vHwPia0/uhjDEhmdvGER2jFRhaXzRLcfk+vta2k0h1bq+ nZIWecWMUPj3g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C64D418005D for ; Mon, 9 Jun 2025 14:51:35 +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.1 required=5.0 tests=BAYES_00,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: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) 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 ; Mon, 9 Jun 2025 14:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1749480815; bh=OxKnIN6lMxaIhEYDP72feeUxv9hoYPTPGYhD1DyjpWs=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=i67ovgaMv9WFHSgZ1okp4z5pm2ImBbyGdIih7oRvEBbybtnwM/hR4T8ZaJ/X+JlYs 7fcZO6/QzYbXFibYEDyKX5trzizVoEPJOiNAougcHfEzXYQby777RT75Gj7vXJTAAO WG5rrTH8vqUAizBqJKEterRtuGXY49JJaDa7mfnInUEhz0xEV1trpvduVPO9eLYH8q Gc5SWj6m7prsfrPQm3x5gw1YIWOSb86tczamlhNlqYiJBTbDB26uZrfJKe98KobOAt AK00ce2EL/MVz86s567qN4Blh/QEPiMEBt6b9dbhxhvg2YukWZUkPtOJPpWRJrI50S CAUlB1Dt5KntA== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 09 Jun 2025 16:53:35 +0200 To: Nick Cc: internals@lists.php.net Subject: Re: [PHP-DEV] Allow hooks in `readonly` promoted properties In-Reply-To: References: <28F14D0F-8483-418D-85D1-660564A4EAE2@nicksdot.dev> <26AA81AF-1610-494D-A811-10F7B282CBD4@nicksdot.dev> <1c0df916e4cfbc746b5dddf935d165a9@bastelstu.be> Message-ID: <3999c537c17adcd06555abda17b9334d@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 2025-06-04 15:39, schrieb Nick: >> Your test cases really only scratch the surface of what should be >> tested. You are basically just verifying that it compiles. In fact you >> are not even testing that reassigning the property is disallowed, >> because the test fails due to a visibility error. In fact it appears >> that the `readonly` check comes before the visibility check, which >> would imply that the `readonly` doesn't have an effect: >> https://3v4l.org/nqgpL > > https://github.com/php/php-src/pull/18757/files#diff-fdc22521b074231ac6de0df97aeb23a4759ad9b668d3b9ed3fedf8727f5795a4R21 > > It checks re-assignment, and expects: > >> Cannot modify protected(set) readonly property Test1::$prop from >> global scope > > It’s tested for readonly props, readonly class and promoted properties. > > Correct me, but this is what you are talking about, isn't it? Anything > else you are missing? Your link to GitHub is dead (probably due to the force-pushes), but the tests in the current version of the PR resolved my question by attempting to re-assign from within the class (such that visibility is not the cause of the error). Best regards Tim Düsterhus