Hi, I had a quick chat with Derick during PHP Benelux about this patch. He suggested to make the DateTime objects in Template immutable. I'm pretty much for doing so and would actually desire to change that in PHP itself, if it would be possible.
Making DateTime objects immutable would result in much more sane behavior of date_modify(), date_add() and friends, since they would no more change the original object, but return a new one which has the desired manipulation applied. We've an implementation for immutable DateTime lying around, which we could just move to Base/ so it's available for others easily, too. Find the code attached. What do you think? Regards, Toby -- Tobias Schlitt http://schlitt.info GPG Key: 0xC462BC14 Want to hire me? Need quality assurance? http://qafoo.com eZ Components are Zeta Components now! http://bit.ly/9S7zbn
<<attachment: immutable_date_time.php>>