Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Stephen Reay
> On 8 Aug 2022, at 20:21, Rowan Tommins wrote: > > On 08/08/2022 10:09, Stephen Reay wrote: >> The RFC states that it’s to keep consistency with `readonly`, because __set >> on a readonly property that’s initialised throws an error - but isn’t that >> because of the nature of it being readon

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Casper Langemeijer
On Mon, Aug 8, 2022, at 10:23, Andreas Heigl wrote: > Your use case might not need them (though actually you are needing them, > you just don't use them as language feature but via the static-analysis > annotation) > > But when discussing language features we should always keep ALL users of >

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Lynn
On Sun, Aug 7, 2022 at 10:38 PM Rowan Tommins wrote: > On 07/08/2022 11:54, Lynn wrote: > > Reading "public private", "public protected", or "protected private" > > reads really weird `public private(set) static self $property`. > > > Interesting, it seems that you've unconsciously broken it up a

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Mark Baker
On 08/08/2022 10:14, Marco Pivetta wrote: As for `readonly`, the reason we sometimes **cannot** use `readonly` is because current `clone` semantics can't work around `readonly` rules (discussed in the `readonly` RFC):https://3v4l.org/og8bn If we solved that, I think `private(set)` would become ev

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Rowan Tommins
On 08/08/2022 10:09, Stephen Reay wrote: The RFC states that it’s to keep consistency with `readonly`, because __set on a readonly property that’s initialised throws an error - but isn’t that because of the nature of it being readonly, rather than because of the visibility rules? The error give

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Rowan Tommins
On 07/08/2022 22:48, Larry Garfield wrote: Something like public private:set (colon instead of parens) would work just as well, if the () are confusing somehow, but that doesn't feel like a common problem. And it would lose the parallelism with Swift. I wonder if the reasoning for Swift's s

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Ollie Read
On Mon, Aug 8, 2022, at 3:54 AM, Mike Schinkel wrote: > 3.) I have concerns about the proposed methods isProtectedSet() and > isPrivateSet(). > > These names feels like we are asking if some thing "Set" is "Protected" or > "Private" where no such "thing" exists in this context. > > In other

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Deleu
On Fri, Aug 5, 2022 at 7:09 PM Larry Garfield 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. > > -- >

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Stephen Reay
> On 6 Aug 2022, at 00:08, Larry Garfield 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. > >

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Marco Pivetta
Hey Andreas, On Mon, 8 Aug 2022 at 10:23, Andreas Heigl wrote: > > Your use case might not need them (though actually you are needing them, > you just don't use them as language feature but via the static-analysis > annotation) > > But when discussing language features we should always keep ALL

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Andreas Heigl
Hey Marco. On 08.08.22 10:14, Marco Pivetta wrote: Heyo Andreas, Casper, On Mon, 8 Aug 2022 at 10:03, Andreas Heigl wrote: Hey Casper. On 08.08.22 09:54, Casper Langemeijer wrote: Hi all, In the discussion I sometimes see the terminology 'readonly' and 'writable' being used. This is conf

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Marco Pivetta
Heyo Andreas, Casper, On Mon, 8 Aug 2022 at 10:03, Andreas Heigl wrote: > Hey Casper. > > On 08.08.22 09:54, Casper Langemeijer wrote: > > Hi all, > > > > In the discussion I sometimes see the terminology 'readonly' and > 'writable' being used. This is confusing because when the property is an >

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Michał Marcin Brzuchalski
Hi Larry, niedz., 7 sie 2022 o 21:02 Larry Garfield napisał(a): > On Sun, Aug 7, 2022, at 5:54 AM, Lynn wrote: > > On Sun, Aug 7, 2022 at 12:34 PM Rowan Tommins > > wrote: > > > >> Can you expand on where you think the ambiguity / implicitness is? As I > >> understand it, the RFC is proposing e

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Andreas Heigl
Hey Casper. On 08.08.22 09:54, Casper Langemeijer wrote: Hi all, In the discussion I sometimes see the terminology 'readonly' and 'writable' being used. This is confusing because when the property is an object that itself is mutable, there is nothing read-only about it. The terminology in th

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-08 Thread Casper Langemeijer
Hi all, In the discussion I sometimes see the terminology 'readonly' and 'writable' being used. This is confusing because when the property is an object that itself is mutable, there is nothing read-only about it. The terminology in the RFC seems right to me, and overall it seems solid. Howeve