@Larry RFC is not updated with the solution for cloning yet. So far I did add changes on which we have agreed on. Currently we have to candidates:
First one is to have copy on write (As Christoph pointed out, we had that in PHP 4). Second proposal is to introduce "transformer" keyword as a method modifier. In "transformer" method $this would basically represent cloned instance instead of the original object. Cheers. 2016-09-11 22:04 GMT+02:00 Larry Garfield <la...@garfieldtech.com>: > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Silvio Marijić Software Engineer 2e Systems