Re: [RFC] Asymmetric visibility
| From: | Deleu | Date: | Mon, 08 Aug 2022 09:45:01 +0000 |
| Subject: | Re: [RFC] Asymmetric visibility | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118386@lists.php.net to get a copy of this message | ||
On Fri, Aug 5, 2022 at 7:09 PM Larry Garfield <larry@garfieldtech.com>
wrote:
> Ilija Tovilo and I are happy to present the first new RFC for PHP 8.3:
> Asymmetric Visibility.
>
> https://wiki.php.net/rfc/asymmetric-visibility
>
> Details are in the RFC, but it's largely a copy of Swift's support for the
> same.
>
> --
> Larry Garfield
> larry@garfieldtech.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>
Just wanted to point out that I loved syntax proposals by Juliette and
Mike. Any of them would be better. Making a better syntax for PHP would be
better than consistency with Swift, IMO.
But I'm also inclined to agree with Marco Pivetta that this change is a lot
less exciting now that we have
readonly. In extremely rare cases where I
need to modify an attribute more than once, I just fallback to private +
getter and the nice thing about it is that it creates a consistent mindset
that if a property is being accessed via a getter, then the reader should
be advised that the property may change depending on WHEN it's accessed.
--
Marco Deleu