Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128112 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 74DA11A00BC for ; Fri, 18 Jul 2025 14:42:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1752849672; bh=WbF9UBx5DCUFq8q4AL1emL7qp2cSiAM8pvMumMhFV4U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=PDCbF4Haty9hvypdzCSL/k6HiErIHeL43xzh1pCZlljWBfukgoTXXPyJIY1PkTToZ iF9pPLYdPYU++KgkU+NiKun2i1nIINWXc700gqMrObshly+eY7gKAFbr7XRFTb35fS l7Ts3TCLZy1woFuzMw96pNXAyI9dFF1NBP+wY/C9iifbhijDuQ/0448Pc7XCIFLotQ TR1yohWMuWjLILzPe976IVYLVKNbm6FUgCQZ8bb92ca0M/NElcRWShA73Bx4sMF6aH spdi1ElbH8BBIU8wJxuWW+u7uwUW2j/h9ed6cJWcnoFsIRSK5dfrESdEqkpA9sh3sn EmrY4zCkAQ/FA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A624318005B for ; Fri, 18 Jul 2025 14:41:11 +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 ; Fri, 18 Jul 2025 14:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1752849775; bh=bP90JoJfTRTpmCMcpv6loZ1R1F9q9NXY7Kt0BlSILME=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=LmaBlFPeit4w4PIw8/0EqZtEMScsxf6o0zVdXK0LgHEz+vVY5M25wMzu7YROwMJTk A2EKmPV2FNynGRn+ms+8CLpyx8GKJlU3fhMlLNR92BxdFvESg2TkXSwFp8YU2boRQF unDcZvxFjLZgWXEkpygtGZNX2Jt/BhIVCkLdXb0w4HBgz83KndanWCP92Ado4jsH0S Ry9K6c8lOB2OeomzkgHOn4KmLr4iSrvqZ2AwxQTWxqAX7GE17Qun23UvnuUUiYTXry 5YpsP8tbyNNKc8xst+fzB4WCYlq3EAtx8Ub8m0kGKuyzKTrUqBZYCO/POF9l0ZUDig AP847e9ErRM9Q== Message-ID: <93a7a354-9779-4c2d-a146-a49388bc0159@bastelstu.be> Date: Fri, 18 Jul 2025 16:42:54 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Readonly property hooks To: Faizan Akram Dar Cc: Larry Garfield , php internals References: <1e8634d7-ac1a-4025-b4e2-1948aabf5251@app.fastmail.com> <46857A6D-5EAF-44AF-A2DE-9B40AF8DE8C8@gmail.com> <41241c3d-a601-4fb8-9f32-976bea3b660e@app.fastmail.com> <308e51e9-ebc9-4ab1-a727-46854b27701f@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 7/18/25 16:25, Faizan Akram Dar wrote: > The problem with allowing only set hooks is that readonly class won't be > compatible with hooks, I think that is one of the main motivations behind > this RFC. Yes. The point is that the semantics users expect from `readonly` are fundamentally incompatible with a get hook that could return arbitrarily changing values whenever you read from a property. Proposing to change this is like proposing an RFC that allows storing a `string` in a property with type `array`. It would be a massive break in user expectations for a feature that existed since 4 PHP versions (in case of readonly). Best regards Tim Düsterhus