Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127823 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 8740C1A00BC for ; Tue, 1 Jul 2025 14:27:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751379926; bh=ctRzU2GmcXIp6QLMKyMFnbWKR8C8/6jM1+7uPw35qc0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OVvpKXjyYLS84HN4VAa4UnP3WOgZFbiryyqYcPjR+N+mbB+TsqsbByZtQFMnBPmKE LOwsn+vsr8UI0BzWTDchB/K4b8A7II8cNJgw7a4wAdoYvPEgI9r/y6E9C4iJJ6GuHs TnZFVjMd3M9M62S/t/KqYkiV7KQToX1KiG5isnQQdSHuRWkeNIZtfsAj4gaqoJjB4i jOOI7DHROn/uLn5R9BsdLqSSHurxp8Y02PMb7/BQv6hbXnpJVSoNrfCk9Mq6hYsiC4 pR+hs1Zd0au1RrpqFedVUTsn1fCcS6cEYN+ai+kz8bO2lrjvKNOWM662XL+h9DnHIb Sw5exyNuyEURQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B3C6C1801DD for ; Tue, 1 Jul 2025 14:25:24 +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 ; Tue, 1 Jul 2025 14:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1751380035; bh=npxT1412OLi4oxmaBnHukxt5vNehEOViUdnzdbI+uns=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=AuTmu/rm9YAJMG/DgIzFTYBsTVqJwoX/+MiZwv6Bszkbmjhbs11tXd0BVwH2l0HJV KYEYpw8GHNeXNpfPhVjmr1CLAxiMWMLGxaoYgjmmcQXWDD1v3BrEwXi4DsrGLWZjby YP1wvGjdwlZtrA5rinCiKmum3Vg2B0tP4Oc9iXNp2nDSLAL7Osk8xZHdqUgf0BjiDy ToxlL5EpuJZiFWkjKOw4tdoFcgcqSSolKG1CnS6O78sTHDqjFa2gAiNwo1OQDC3bu3 AySZOm47CEySSmoayXQOf53Cxgp9w3o70gO8jYRYaXTxT/2eTDjScfgpVsdNsUunNc XQ6xIYH1XuhBg== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Tue, 01 Jul 2025 16:27:15 +0200 To: Larry Garfield Cc: php internals Subject: Re: [PHP-DEV] [RFC] Readonly property hooks In-Reply-To: References: <1e8634d7-ac1a-4025-b4e2-1948aabf5251@app.fastmail.com> Message-ID: 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-09 17:11, schrieb Larry Garfield: > I also fleshed out the __get mention with an example that shows what > you can already do today, and in fact could since 8.1 when readonly was > introduced. The hard guarantee of idempotency has never actually been > there. (This also speaks to Claude's concern.) I don't think this really resolves Claude's concern. While it is certainly true that the guarantees do not currently hold, I don't believe this is strong enough of a reason not to provide for stronger guarantees in a *newly introduced feature*. The point of property hooks is for me that “dynamic properties” are easier to reason about compared to `__get()`. As a user when accessing a proper `readonly` property, I do not want to check if there is a property hook that might result in non-readonly behavior. As an engine developer I want to be able to optimize based on the `readonly`-ness of a property. Without such guarantees, the “readonly” keyword does not provide value to me. I also believe the LazyProduct example to be broken, since lazy-loading individual properties might result in an object that is internally consistent if the database changes in-between. Best regards Tim Düsterhus