On 07/09/16 10:28, Silvio Marijić wrote: > DateTimeImmutable does not prevent cloning because immutability is achieved > by encapsulation, and we want to get rid of the need of encapsulation in > our implementation of immutable objects.
What is the problem with 'encapsulation'? By that I mean creating readonly result set from class and packaging it with just the links to the functions that display those results. Nothing stopping the class building multiple objects, and the construction code is unnecessary once the target has been created. Simplifying access to the set of variables making up the object might help with all the different options for getters and the like, but essentially the object is just a set of variables which build a result which may potentially just be a pre-formatted string or a number. In my book date/time is still a 32bit day count and 32bit time fraction so a DateTimeImmutable is just a 64bit number ... which you can't write to. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php