Open RFCs

Asymmetric Visibility v2

A new syntax for declaring the “set” operation visibility of an object property

29% 71%
18
16 yes
39 no
new MyClass()->method() without parentheses

Chain method on newly created objects without parentheses

85% 15%
54
94 yes
16 no
Property Hooks

A new way of interacting with properties

61% 39%
70
141 yes
90 no

Argument of the Day

5

I'm conflicted about this RFC. I definitely have use cases for "publicly readable and privately writable" properties. Especially since we still don't have clone with. I'm a afraid of the overlap between asymmetric visibility with readonly properties. By introducing asymmetric visibility, we make readonly properties essentially useless (asymmetric visibility can do the same, and more). I wonder how the community will deal with such a change: readonly properties were introduced in PHP 8.1, what happens if they become obsolete only a couple of versions later?

Despite my worry, I like this proposal on its own, and it would actually be useful to me in many cases. In the end, I'm inclined more towards voting yes than no.

Share:
Read the RFC: Asymmetric Visibility v2 Contributor brent avatar
brent
voted yes
RSS Feed Contribute Watch on YouTube Our License
© 2024 RFC Vote. This project is open source. Contribute and collaborate with us!