Re: [PR] DateTime::createFromImmutable() method

From: Date: Mon, 09 Mar 2015 10:35:34 +0000
Subject: Re: [PR] DateTime::createFromImmutable() method
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-84459@lists.php.net to get a copy of this message
On Thu, 5 Mar 2015, Trevor Suarez wrote: > Good morning internals! > > I would like to propose a small addition be made to the DateTime class. > > https://github.com/php/php-src/pull/1145 When the factory method was added, we had this same discussion. And the discussions lead to the conclusion that it does not make sense to have this "createFromImmutable" factory method on DateTime. Basically with the same reasons that people should type hint against the Interface instead. To emulate that in PHP 5.5 and lower, users can just do: class DateTimeInterface extends DateTime {} I know, that's a bit of a hack. I am against this addition, even though the patch looks OK. cheers, Derick

« previous php.internals (#84459) next »