Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119012 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 822 invoked from network); 15 Nov 2022 10:33:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Nov 2022 10:33:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3527B18004D for ; Tue, 15 Nov 2022 02:33:59 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS30827 82.113.144.0/20 X-Spam-Virus: No X-Envelope-From: Received: from xdebug.org (xdebug.org [82.113.146.227]) by php-smtp4.php.net (Postfix) with ESMTP for ; Tue, 15 Nov 2022 02:33:58 -0800 (PST) Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id C0BD010C035; Tue, 15 Nov 2022 10:33:57 +0000 (GMT) Date: Tue, 15 Nov 2022 10:34:09 +0000 (GMT) X-X-Sender: derick@singlemalt.home.derickrethans.nl To: Ilija Tovilo cc: php internals In-Reply-To: Message-ID: References: <0854b030-c51c-4c1b-a7dd-22835a1e5da9@app.fastmail.com> User-Agent: Alpine 2.23 (DEB 453 2020-06-18) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1057129240-1668508449=:1167818" Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, with readonly From: derick@php.net (Derick Rethans) --8323329-1057129240-1668508449=:1167818 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 14 Nov 2022, Ilija Tovilo wrote: > Hi Derick >=20 > > > As I understand it, you=E2=80=99re suggesting that a property declare= d as > > > `public protected(set)` would never trigger __set(). > > > > I would think that that would be against our current practice, which is > > easy enough to explain as "if the property isn't visible set, > > then use __set()". I would argue that "protected(set)" marks a property > > as invisible from a non-inherited class/method, and hence __set should > > be called. >=20 > What you're describing does not match the readonly behavior. > https://3v4l.org/X76pV >=20 > Readonly properties only call __set once they are explicitly unset. > The same applies to __unset. I changed this in the asymmetric > visibility implementation recently to match this behavior but the RFC > has not been adjusted to reflect this yet. >=20 > AFAIK this behavior is there to allow calls to __set for certain edge > cases. While not very intuitive it makes sense to stay consistent. If > this behavior is undesirable we should change it in both places. Now I have re-read the Assymetric Visibility RFC's "Interaction with=20 __set"=20 (https://wiki.php.net/rfc/asymmetric-visibility#interaction_with_set),=20 I'm slightly more confused. Could you update that section, as what it=20 currently states seems reasonable. cheers, Derick --8323329-1057129240-1668508449=:1167818--