Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128105 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 8CEC71A00BC for ; Fri, 18 Jul 2025 12:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1752842160; bh=5bpn3ecWXnM9opxJqvxa7boogp/orCvQmMAy2TR/qJM=; h=Date:Subject:To:References:From:In-Reply-To:From; b=UHYZ2WMToNcouZGKMLgbdpDYZAYq9ifhl1Dj4IOOkQRQ2mO3vHuEuSf8ozT6AALqR QLljszU/ESGvkoG9zK1JIluZ6ziDXkSDpJcf8rvQB+zmm0Sj7R43JSiXUEc7E6Ir4T gNLt5J9IFL5jR+xrm1IhikXE46PAs1CkRNte/W2ww/lIOcJd8SooZSVywtqZjiJoq4 ad8Ni0T5HMqAC6pusVT38jC9xDEYNtNYZyEKPTtR8hrpxnSOvdY4BVWfvvRM6xuoHN PU3NjN2hkG5WDaihBVprfNL5yA5rgRCrVQjs3O++jGTCr67+Q9SwuDrnRMXm065jRv 4GzxGjOG9QrEg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0A150180586 for ; Fri, 18 Jul 2025 12:36:00 +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 12:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1752842265; bh=2VMQ6WUPRBFk0NuMKP41kvUe6NcHGNYqExmE/x/jri4=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=WaPYtqYJZnF1Tq3IFdV4NH99l6fpqv9wiCo2xisrfSVNtSZ4RqB+nAvgZxDdRVEUT ZK5OJGWC0RtJPu+DUj3ZcQtYcX16cm9ZimUhNa0DQlr3NzeLEM5JD1oWaO7/FYWfU1 zVg6aHQNKEJTRhlfEzAV39laSCqPDWY8S8PybiwFQRLdZs02YMmAtHksdUALOm9uyN qByTXzAr+i6Ko/BQiCkuDyY3T4Y9TiJ38WmQXKcZHsPl4TV1Qvbn+QgFWp0+jGMhiY BaxdiidHK66a4KqHNFzGWqdF/x63Gwj8nEhui6NEkYdLfAOeXubhjJmdsCstuwA+zD Im2A4IkI5luzw== Message-ID: <55f961d7-7967-461d-bfd8-77a82184e340@bastelstu.be> Date: Fri, 18 Jul 2025 14:37:44 +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: 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> <922a21f4-c28c-4824-b1d6-0c53ae080ffb@app.fastmail.com> Content-Language: en-US In-Reply-To: <922a21f4-c28c-4824-b1d6-0c53ae080ffb@app.fastmail.com> 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 see also my previous reply to your email where you initially mentioned init hooks. On 7/9/25 19:11, Larry Garfield wrote: > Can an init hook reference itself, the way get and set can? If the init hook references its own property you will get endless recursion. > If there is both an init and set hook, what happens? Is it different if set reads from itself than if it writes to itself? The first bit I answered in my previous email. If set reads from itself and the property is uninitialized, it will invoke the init hook. > Should combining init and set be forbidden as confusing? No. > Can you have both an init hook and a get hook? What happens then? See previous email. > Repeat all of the above on readonly properties. No difference, except that the 'get' hook should not be allowed there. > there is a reasonable solution right in front of us that is trivial to implement. I disagree on the "reasonable" part. Best regards Tim Düsterhus