Re: [RFC] [DISCUSSION] Immutable/final/readonly properties

From: Date: Sun, 15 Mar 2020 13:04:12 +0000
Subject: Re: [RFC] [DISCUSSION] Immutable/final/readonly properties
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Groups: php.internals 
Request: Send a blank email to internals+get-109025@lists.php.net to get a copy of this message
Hi Marco, Yes, it still allows default values. The reason why I'm reluctant to disallow them is that this restriction would feel a bit ad-hoc for me. I mean, I wouldn't like to add another special rule for "write-once" properties, unless there is a strong argument for it. Besides, as far as I know there is no precedents of disallowing default values of similar properties in other languages, so I feel that the feature would stay the most intuitive as it is now. However, I'm eager to listen any objections about this. I know for one that ProxyManager wouldn't work with "write-once" properties having default values. But can we consider this use-case an edge case, right? Could users circumvent the issue just by changing the default value to an assignment in the constructor? Or would it cause a big headache for them? Máté Marco Pivetta <ocramius@gmail.com> ezt írta (időpont: 2020. márc. 14., Szo, 22:53): > Hey Máté, > > Is the RFC still gonna allow default values (constants, at this point)? > > While I don't see a major problem with it, it seems a bit weird... > > On Sat, Mar 14, 2020, 12:00 Máté Kocsis <kocsismate90@gmail.com> wrote: > >> Thank you, Larry, for your response! I share your opinion. However, I'd be >> curious if there is anyone who doesn't? >> >> As things currently stand, I plan to start the vote on Monday with an >> unchanged proposal (+ an extended future scope section). >> >> Máté >> >

« previous php.internals (#109025) next »