On 12/11/2016 5:57 PM, Silvio Marijić wrote:
> Hi,
> 
> Discussion is open for following rfc https://wiki.php.net/rfc/immutability
> 
> Cheers
> 

-1 from my side for all the things previously mentioned. The
copy-on-write topic must be solved along with the introduction of
immutable classes or we end up with this being implemented and not way
to mutate them in a controlled fashion.

Also -1 on the proposed `copy` or `modify` function. Not only does it
seem to allow anyone to mutate the immutable object, it also requires
magic strings of the property names. No usage search, no refactoring, no ...

I still strongly believe that `__clone` should be made `private` or
`protected` for immutable classes to avoid useless cloning. After that
we either stick to cloning as we currently do in our `with*` methods or
we provide a keyword that changes the behavior of a method.

I also propose to use `data` or `value` instead of `immutable` as the
class modifier keyword. Its shorter and properly as well as fully
communicates what kind of object we are building.

-- 
Richard "Fleshgrinder" Fussenegger

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to