Re: RFC - Immutable classes
| From: | Larry Garfield | Date: | Sun, 11 Sep 2016 20:04:38 +0000 |
| Subject: | Re: RFC - Immutable classes | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95918@lists.php.net to get a copy of this message | ||
On 09/10/2016 05:55 AM, Fleshgrinder wrote:
So? Where are we now? CoW is definitely doable and I personally think that it's the best approach because the engine has full control that nothing goes south. I also do not think that it's magic in any way since developers have to add the _immutable_ keyword explicitly to the class. That this modifier modifies the behavior should be obvious, _abstract_ and _interface_ also do that. Since I mention _interface_. I've been thinking about it and I would prefer it if the _immutable_ modifier also works for interfaces. Interfaces are pure abstract classes after all and they are meant to define a contract for implementors. I cannot see any good reason why it should not be allowed to force implementors of an interface to be immutable; same as with abstract classes. Another aspect that we should discuss is how immutable properties should behave in case we decide for CoW. @Larry what do you think about the CoW proposal?I'm afraid I got lost in the thread somewhere with the back and forth about implementation details. Can you repost the current proposal, or has the RFC page been updated with the latest CoW-based recommendation? --Larry Garfield