Hi Benjamin, On 01/31/2011 02:26 PM, Benjamin Eberlei wrote: > Ah nice approach to avoid the infinite loop, but I got a better one: > > https://github.com/beberlei/Whitewashing/blob/master/DateTime/DateTime.php > > Feel free to take this code, its new-bsd.
thanks for the recommendation. Using the procedural interface of DateTime is indeed a good idea. I'll take your code as inspiration for the final version. > btw, I proposed an Immutable DateTime objects patch to the Internals list > 1-2 month ago that was rejected for it adding a $immutable = true/false > flag only instead of fixing the underyling problem. Fixing the underlying > problem is too huge a task for my non-existant C skills though :-) I doubt PHP will fix this issue by making the current DateTime implementation immutable, since it would mean a BC break. Even if they'd really do, that'd be for 5.3.$x or even later, so we would need to work around it anyway. Therefore I'd really suggest we provide a proper implementation in userland with our Base component. Thanks for your feedback, cheers, 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