Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-18 Thread Larry Garfield
On Tue, Mar 17, 2020, at 1:07 PM, Máté Kocsis wrote: > At this point I'd like to repeat one of my previously mentioned arguments > for the feature: > if we have an immutable PSR-7 that is used all over the PHP ecosystem, and > we also have > lots of people who wish for more type-level strictness

Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-17 Thread Máté Kocsis
Hi Levi, Thank you very much for your feedback! I'll try to answer some of your concerns. Chiming in to express my disappointment that `final` wasn't a voting choice. > When I started to draft the RFC, I realized that a final property modifier that I wanted to propose would be pretty much

Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-17 Thread Levi Morrison via internals
Chiming in to express my disappointment that `final` wasn't a voting choice. 1. It's already reserved, so we don't have to worry about a new keyword. 2. Another very popular language that is similar to PHP already uses it (Java). I voted no for a variety of reasons, which includes: - It

Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-17 Thread Máté Kocsis
> > Both proposals relate a lot to each other: it's one or another, both cannot > coexist: there is only one meaning for the "readonly" keyword once it's > bound to some interpretation. You are right in the sense that the two proposals can't use the same keyword. However, I believe we both agree

Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-17 Thread Dan Ackroyd
Nicolas Grekas wrote: (from the other thread) > there must be a way to work around the keyword - > either via reflection or another means. Can you expand on why there 'must' be a way to work around this? Can you provide some example code where not being able to change the value is going to cause

Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-17 Thread Nicolas Grekas
> I'd like to reiterate my answer then: I think your idea and my proposal > doesn't try to solve the same problem. > Like you write in the RFC: > Although actually “write-once” properties and property accessors are orthogonal to each other, it's arguable whether we still needed “write-once”

Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-17 Thread Máté Kocsis
> I don't think these issues can nor should be figured out later on: they > are low-level conceptual issues IMHO. I don't agree. Initialization would for example 100% work, I only removed it from the proposal at the end because we'll have more freedom to add new language behaviour until we find

Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-17 Thread Nicolas Grekas
> I believe we had a long enough and fruitful discussion period, > so I have just opened the vote at > https://wiki.php.net/rfc/write_once_properties > since I didn't want to add any significant change to the proposal > any more. > > The vote will run for 2 weeks and it will be closed on

Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-17 Thread Máté Kocsis
Hi Aleksander, Thank you for the comment! You are right, the is missing from there. I believe we can correct small typos/grammatical errors as far as the contents of the RFC stays the same. That's why I've just fixed the issue. Cheers, Máté

Re: [PHP-DEV] [RFC] [VOTE] Immutable/final/readonly properties

2020-03-17 Thread Aleksander Machniak
On 17.03.2020 11:12, Máté Kocsis wrote: > I believe we had a long enough and fruitful discussion period, > so I have just opened the vote at > https://wiki.php.net/rfc/write_once_properties > since I didn't want to add any significant change to the proposal > any more. I'm not sure the RFC can be