Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120216 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24693 invoked from network); 9 May 2023 07:57:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 May 2023 07:57:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 92F151804DF for ; Tue, 9 May 2023 00:57:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 9 May 2023 00:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1683619048; bh=oYI1Paz/OyEU/Ea+kUAv1peBzI9wH/susrrU6fUG/pg=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=d/0eXgOv7AU1431xOwUZbGPjIln6yOoVkV0GSga77AEfF/1hq7G03w5HABT4/cbwI H24mV+gY9FMrDLglxlk6CfD/Y36bW2nh1/RapsIzq7kLMXUzz92GxC7YMQ5Jttkavl lhEJQLy4YNJzcXhtyQZ9mgssNP7+JtDqoKd+ABZudrZLl6obTnx/k7ifUhGXwUnzOf zy4j9Rz5oH8d3tt3HPDi+QdypN+HA5bJy49tgonbk/00jfnioupHqVq5QPaRWhZ0P2 baDGZbxuI89FlnYrdwQIKMeDq3QulTI6Qo5sr11z9+CbbJ0zaM6LPnO1XjiyceFgu4 LXt4VOfk6uMVw== Message-ID: <17d7983b-68b7-e273-a445-f8399c2510cc@bastelstu.be> Date: Tue, 9 May 2023 09:57:26 +0200 MIME-Version: 1.0 To: Larry Garfield , php internals References: <641b1ca0-d33f-4f38-ae64-81b4abce24da@app.fastmail.com> Content-Language: en-US In-Reply-To: <641b1ca0-d33f-4f38-ae64-81b4abce24da@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Property hooks, nee accessors From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi On 5/8/23 23:38, Larry Garfield wrote: > Ilija Tovilo and I would like to offer another RFC for your consideration. It's been a while in coming, and we've evolved the design quite a bit just in the last week so if you saw an earlier draft of it in the past few months, I would encourage you to read it over again to make sure we're all on the same page. I'm actually pretty happy with where it ended up, even if it's not the original design. This approach eliminates several hard-to-implement edge cases while still providing a lot of functionality in one package. > > https://wiki.php.net/rfc/property-hooks > I've read a previous draft and now did another pass through the updated version: (1) How does the set() hook interact with #[\SensitiveParameter]? (2) How will a Stack Trace emitted from a hook look like? Please include an example of the Exception::__toString() output or so. (3) ReflectionProperty::getHook(): Will this throw if an invalid hook name is given or will this return null? (4) The "Unaffected PHP Functionality" section is empty. It should either be filled in or removed. (5) I strongly dislike the doubly abbreviated form of `public string $fullName => $this->first . " " . $this->last;`. Having just the extra '>' in there to distinguish it from a regular property feels non-obvious. Best regards Tim Düsterhus