Levi Morrison wrote:
While I personally think DateTime should have been immutable from the
beginning, I don't think it's in PHP's best interest to try to fix
this particular problem by introducing DateTimeImmutable.

There seems to be some strange assumption that a DateTime value is fixed in some way? There have been various statements about 'should have been immutable from the beginning', and while I can see that some uses of it are read only, much of my own use is in building calendar arrays where one is adding months, days or hours to select the next set of matches. If this should always have been 'immutable' then how would one handle all the situations where one does need to update the value?

Now there has been discussions about setters and getters and read only, so surely this is just another example of something were flagging a variable as read only would be useful rather than programming in yet another special case?

--
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

Reply via email to