[Vote] Asymmetric visibility v2

php.internals

Larry Garfield

2 years ago
Voting for Asymmetric Visibility is now open. https://wiki.php.net/rfc/asymmetric-visibility-v2 The vote will end on 9 February, probably afternoonish in my timezone.
-- Larry Garfield larry@garfieldtech.com

Andreas Heigl

2 years ago
On 26 July 2024 18:25:53 UTC, Larry Garfield <larry@garfieldtech.com> wrote:
> Voting for Asymmetric Visibility is now open. > > https://wiki.php.net/rfc/asymmetric-visibility-v2 > > The vote will end on 9 February, probably afternoonish in my timezone. >
That's a pretty long voting period...
-- Andreas Heigl

Bilge

2 years ago
On 26/07/2024 19:39, Andreas Heigl wrote:
> On 26 July 2024 18:25:53 UTC, Larry Garfield <larry@garfieldtech.com> wrote: >> The vote will end on 9 February, probably afternoonish in my timezone. > That's a pretty long voting period...
It seems he meant the 9th of August.

Bilge

2 years ago

Larry Garfield

2 years ago
On Fri, Jul 26, 2024, at 6:54 PM, Bilge wrote:
>> Presumably the proposed PHP version is wrong?
No, this is still within the window to target 8.4. --Larry Garfield

Larry Garfield

2 years ago
On Fri, Jul 26, 2024, at 6:25 PM, Larry Garfield wrote:
> Voting for Asymmetric Visibility is now open. > > https://wiki.php.net/rfc/asymmetric-visibility-v2 > > The vote will end on 9 February, probably afternoonish in my timezone. > > -- > Larry Garfield > larry@garfieldtech.com
Sigh. And of course I meant the voting will end on 9 AUGUST, aka, two weeks from today. (No idea where that came from.) --Larry Garfield

Theodore Brown

2 years ago
On Fri, July 26, 2024 at 12:25 Larry Garfield wrote: > Voting for Asymmetric Visibility is now open. > > https://wiki.php.net/rfc/asymmetric-visibility-v2 Hi Larry and Ilija, Thank you for all your work on this RFC! One part that doesn't make sense to me is this sentence near the end in the "Readonly is incompatible with inheritance" section: > With asymmetric visibility, the `readonly` usage here can be replaced with `protected protected(set)` or `readonly protected protected(set)`, avoiding the need to double-declare properties. `protected protected(set)` just removes readonly, and is the same as `protected`, right? So couldn't such a change be done now without asymmetric visibility? And the change to `protected protected(set) readonly` as shown in the example also seems unnecessary, since earlier in the RFC it says that readonly will be changed to imply `protected(set)` rather than `private(set)`. So it seems that no change is needed to the abstract class here - the properties can remain `protected readonly`, and the implementation can be simplified since readonly properties will now imply `protected(set)`. Or have I misunderstood something here? Thanks, Theodore

Larry Garfield

2 years ago
On Mon, Aug 5, 2024, at 8:49 AM, Theodore Brown wrote:
> On Fri, July 26, 2024 at 12:25 Larry Garfield wrote: > >> Voting for Asymmetric Visibility is now open. >> >> https://wiki.php.net/rfc/asymmetric-visibility-v2 > > Hi Larry and Ilija, > > Thank you for all your work on this RFC! > > One part that doesn't make sense to me is this sentence near the end in > the "Readonly is incompatible with inheritance" section: > >> With asymmetric visibility, the `readonly` usage here can be replaced with `protected protected(set)` or `readonly protected protected(set)`, avoiding the need to double-declare properties. > > `protected protected(set)` just removes readonly, and is the same as > `protected`, right? So couldn't such a change be done now without > asymmetric visibility? > > And the change to `protected protected(set) readonly` as shown in the > example also seems unnecessary, since earlier in the RFC it says that > readonly will be changed to imply `protected(set)` rather than > `private(set)`. So it seems that no change is needed to the abstract > class here - the properties can remain `protected readonly`, and the > implementation can be simplified since readonly properties will now > imply `protected(set)`. > > Or have I misunderstood something here?
I believe in this case you're correct. That example was written early on, before we decided to expand readonly to protected(set) by default. I didn't realize that needed to be updated as well. Yes, in this case, the widening of readonly would also resolve that issue. `protected protected(set)` would now be redundant, but not hurt anything, whereas `protected private(set)` would have an effect. `public public(set) readonly` would also be legal (though I don't personally know why you'd do that, there's no inherent reason to make it illegal). --Larry Garfield

Larry Garfield

2 years ago
On Fri, Jul 26, 2024, at 1:25 PM, Larry Garfield wrote:
> Voting for Asymmetric Visibility is now open. > > https://wiki.php.net/rfc/asymmetric-visibility-v2 > > The vote will end on 9 February, probably afternoonish in my timezone.
I have now closed the vote on this RFC. The final result is 24 Yes, 7 No, for a total of 77.4% in favor. The RFC has passed. Thanks everyone for your participation and input. Ilija will get the PR merged soonish. --Larry Garfield