Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127531 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 9D42A1A00BC for ; Mon, 2 Jun 2025 13:39:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748871459; bh=pwOC08q7f+6ZUGJ8WmiWh7J4xGkbS5AvDGUmhnFjB74=; h=Date:From:To:In-Reply-To:References:Subject:From; b=K+wQMeNU3T4kXwSFnkqYTZEKdwXmJM6p3/F03nlJenxH3p6fzQ/mWnFEyJnlgEKmU 5/evSjDNrJ5wTYfw8R1l/Wkwlnvc7nFGoIQE0O/citGnl4Wj3M/n/g6ot+5RZZz2x0 sWxOb0ucVaP2ABbskZkMrAXDqlhCp57nbrC8HkIgb8DG/uUXTFyk2/KiVCVIx6iPe9 bVUp5ZugKdwRcBxy8Ml3oVEaNianR8ZIBldaAVgyN1qiC0Q9DIPbSMgJ2u5uQcsOBg 7oGGlsq5IsYlf89d+Z7Y4CXyEwriAvSLxAEcFDyM1O4rNUEAykKuK5UxybeVf1B+7v 8CTAjFNI5HkNA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3C7AC180042 for ; Mon, 2 Jun 2025 13:37:39 +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=-1.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE 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 fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 2 Jun 2025 13:37:28 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 0FE0311401A2 for ; Mon, 2 Jun 2025 09:39:33 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Mon, 02 Jun 2025 09:39:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm1; t=1748871573; x=1748957973; bh=Mb1fFJYLrb1Mv8ZSBUIwg rAVVkJTayl1MeNAoVad9lc=; b=UOv07JsnfWn8JDpftg3BITDVCjywzMVM7Vzq+ Zg+8qEpyAkjMJW+D5vj8dFC2ZayJUReUd9mJrQnXdDYr/xHUvnnK+kwhXvc3juqc 6KD7XdRr91vrOlfA4nyC76KI4l/jnjHkeURgxx2dEP9sPhjPyh0iyC7E3tkQ/NFc ECG6AEfipVaF40O56nWbHPjMCaoAx2fLNqbHLB7K5o0Xr8FQ3pJ6zzwo2GJuV5Vo k5w+TXcORxJoWOYA1aYHH7pziSvJbky8soUNniag5aTF/1Froh/jHtnTy06NjjWP F0CknPP+zWQsFGKEhMjVaRqXKZZxlnsdtvQGeq56ANgsuRcUQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1748871573; x=1748957973; bh=M b1fFJYLrb1Mv8ZSBUIwgrAVVkJTayl1MeNAoVad9lc=; b=lHgqLT1PfunzircWv eJLYov4U1I+DVojRxdNBDxfOC9U5BvaW0rgwFuMu5WG35DZZWvlhHEfO0zmHVq6o FXkwaQFKkYgUU5PkdqPFbXqMSIwM0nSvA4YLZsAIPkHhLeBqMrAh+jj2yrVzUIE8 XQDEnmxHmKH7ttPwekXnuXNINpTpSeBjB1c+u31mUKLelEZKXEkIp2ZotUpnx3FS po3+21lkgZHMvGXyq2yKzqQD004ndJPKqXsc3A4gF05vygjXn32bc5tRrSrf3L/r F5D7OcWJD14Jqzc/T6yaxbGQmMKf8usS+6oMtXN13AssBULC8p3noY3AnG6pmwP1 1gvZQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdefjeekvdculddtuddrgeefvddrtd dtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggft fghnshhusghstghrihgsvgdpuffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftd dtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefoggffhffvkfgj fhfutgfgsehtjeertdertddtnecuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufd cuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghr nhepueevvdduhffffffhleeuhedvjeevgfelgeetgefftedufeelheegfedvheegleetne cuffhomhgrihhnpehphhhprdhnvghtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpd hnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhht vghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id B6017700063; Mon, 2 Jun 2025 09:39:32 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T81b2c40af9f93484 Date: Mon, 02 Jun 2025 08:39:12 -0500 To: "php internals" Message-ID: In-Reply-To: References: Subject: Re: [PHP-DEV] Allow hooks in `readonly` promoted properties Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Mon, Jun 2, 2025, at 7:49 AM, Nick wrote: > Dear Internals, > > I am sending my first message here. Thank you all for your hard work! Greetings. > I believe promoted properties should allowed for `readonly` properties > and in `readonly` classes. This would help us to avoid the unnecessary > boilerplate like outlined above. > > That said, I would greatly appreciate if internals could explore to > allow `readonly` for hooks in promoted properties in 8.5.--Cheers & > thanks,Nick This was discussed heavily in the design and discussion phase for hooks. The main problem is that the expectations for readonly and the expectations for hooks don't always align. For example, if a virtual property has a get-hook, can it be readonly? We cannot guarantee that the property will always return the same value, but that is rather the expectation of readonly. Given how large and complex the RFC was already, we collectively decided to punt on that question until later. Ilija and I did tepidly propose loosening the restriction slightly: https://wiki.php.net/rfc/readonly_hooks Though we've not gotten back to it as we've both been busy and there hasn't been a ton of calls for it, and it likely still needs to be tweaked some. Another possibility might be to have the readonly marker on a class just skip applying to virtual properties. So you cannot specify it explicitly, but a class-level readonly no longer causes a conflict. I don't know how viable that is off hand. --Larry Garfield