Re: DateTimeImmutable

From: Date: Wed, 27 Mar 2013 14:57:32 +0000
Subject: Re: DateTimeImmutable
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-66834@lists.php.net to get a copy of this message
On 3/26/13 3:29 PM, Michael Wallner wrote:
I am concerned by the introduction of DateTimeImmutable extending DateTime ...
If interoperability was in mind, it will not be given, because every single API which has been written in the last seven years and has DateTime in it's signature is potentially broken. The code may and should be able to expect a modifiable instance of DateTime, which is no longer guaranteed. ...
In my opinion, the only way to "solve" this issue is through documentation, advocation, publication and providing DateTimeImmutable as a sibling to DateTime.
Much agreed. DateTimeImmutable is welcomed as a better design, but it is not a clean substitute for a DataTime object. Steve Clay -- http://www.mrclay.org/

« previous php.internals (#66834) next »