Re: [PHP-DEV] [PR] DateTime::createFromImmutable() method

2015-03-09 Thread Matthew Leverton
On Mon, Mar 9, 2015 at 5:35 AM, Derick Rethans wrote: > 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 t

Re: [PHP-DEV] [PR] DateTime::createFromImmutable() method

2015-03-09 Thread Derick Rethans
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

Re: [PHP-DEV] [PR] DateTime::createFromImmutable() method

2015-03-05 Thread Dennis Birkholz
Hi Trevor, I had no look to the code as I am no C or internals guru. I just wanted to add that I would prefer a generic DateTimeInterface::createFromInstance(DateTimeInterface $copyFrom) method, so you do not need to distinguish between DateTime and DateTimeImmutable when creating a new instance.