On Wed, 27 Mar 2013, Lester Caine wrote: > 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?
The updated value is still returned, it's just that the original object you call (f.e.) ->modify() on is not. cheers, Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php