Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120218 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42765 invoked from network); 9 May 2023 11:52:22 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 May 2023 11:52:22 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E8B231804D7 for ; Tue, 9 May 2023 04:52:18 -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=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 9 May 2023 04:52:15 -0700 (PDT) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-50be0d835aaso10472498a12.3 for ; Tue, 09 May 2023 04:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683633134; x=1686225134; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=FIb74Al3tJLOzXZJ9lT16O5s6tqYryMdHLaf+aqwDNc=; b=RHtmdcm8GHqcvlufon353fasHptp8h28kgy177+iVI9+FcxZthKSSDtZEqoAb99Yf0 0AFBYfKOTFV/RauOJA5JiQnc7bMGx5j/b+OrndxRpzAZPcnNSCyO47bRYx4L5vqWE2AZ JOD6XQ/Tv3fXy8TB+NPT/+YPKq+cT2az4eNiSXShlxIlCyzHt5V4XdQ4qW1xj4dPWzsX h5K85L+0nXamDteylf/OLfe9XRY9hNt4VzBSTLgx///NzwiT0iirEtfmrkgEj4Cvk3+X FuidjEj6Yi62rX7h8kV1UFFnfj7HP81a0ch+j6tKBrLtFZDbA1XsWEmnoGKmLJEp3SIC qpWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683633134; x=1686225134; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FIb74Al3tJLOzXZJ9lT16O5s6tqYryMdHLaf+aqwDNc=; b=WWnK45irlYtfiqIQPWXRurJ7n3cg8y+AwmkbCLMgnhdjXuBKmTQbG9NiqdoYyUVpCT R47i9XbNT4CRE6XPsh0hbdmvRyScsH4NxyfUGAAPXZKBBEynWGoeb2+1O8GM9ICmEbf5 3RlOdDv8BiTMHYqxZxJZC2LAiu58fFlaTOvOp730nkPcKoCUwBSkeyAAtkcx9vXa/rn3 D+csrYbPK0FausHvlwT8RRH+61UwGRPvlBAn/afBjNbc9XLi/SPhDS7B2t6HgbNR21lL 1mjPjqFngDIJwcOtbSJzbrsx2+z1lIDR4zltkClCaaWXkRa4DitiPSvJ3Hac/CEYKaiA GP+w== X-Gm-Message-State: AC+VfDwJg7yKmaZxEuKD39YESR1gYdZgq0lZObM4eGWQMGiYgE1yN+uw TaH/OtD/VGETx3AeUhlb9if3h4g5kBQ= X-Google-Smtp-Source: ACHHUZ7xhveKCCnjhQZ7JpjhKmL/7ZqISokQXhrN3Vkw096vVMj29mjY8bmAItLTTiGod/FXUcnXYw== X-Received: by 2002:aa7:c2d7:0:b0:50b:c397:bbba with SMTP id m23-20020aa7c2d7000000b0050bc397bbbamr11610121edp.31.1683633134056; Tue, 09 May 2023 04:52:14 -0700 (PDT) Received: from ?IPV6:2a02:a45e:66ed:1:89db:3d82:f696:2fdc? (2a02-a45e-66ed-1-89db-3d82-f696-2fdc.fixed6.kpn.net. [2a02:a45e:66ed:1:89db:3d82:f696:2fdc]) by smtp.gmail.com with ESMTPSA id v16-20020a056402185000b0050cc4461fc5sm664732edy.92.2023.05.09.04.52.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 May 2023 04:52:13 -0700 (PDT) Message-ID: <40e1f208-4bda-bd8e-da28-2341948b343d@gmail.com> Date: Tue, 9 May 2023 13:52:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 To: internals@lists.php.net 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: 7bit Subject: Re: [PHP-DEV] [RFC] Property hooks, nee accessors From: dik.takken@gmail.com (Dik Takken) On 08-05-2023 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 > Thanks for all the work that has gone into this. It looks great. The ability to add properties to interfaces is also really nice. One thing that concerns me is the following: "the use of [] on any property (with or without a key) will result in a runtime error being thrown". While the intent of the RFC is to allow adding hooks without causing BC breaks, this detail does introduce a BC break. And the break may get introduced without realizing it. I'm not sure which solution would be best here: Just accept the limitations for arrays (same as for list properties in Python) or forbid the use of hooks for array properties? I'm leaning towards accepting the limitations, like Python does. Then it is up to the API designer to decide if a property hook is the right tool for the job or not. Regards, Dik