Re: DateTime improvement

From: Date: Tue, 11 Dec 2012 09:08:45 +0000
Subject: Re: DateTime improvement
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-64249@lists.php.net to get a copy of this message
As Nikita says, from an ORM perspective, an object is always immutable (at least with current implementations I know of), and that's because they can simply use the object hashes to identify two different objects. While this may be a niche to many of you, I've encountered a quite big amount of people just modifying their DateTime objects with the existing API and then complaining about their date not being saved to DB. I don't believe (at all) in "if you don't need it mutable, don't use modify() oroverride modify()". If the API is there, people will use it. We tried to implement an immutable DateTime in userland, but it doesn't work out well... Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/

« previous php.internals (#64249) next »