Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84459 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41746 invoked from network); 9 Mar 2015 10:35:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2015 10:35:39 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:59723] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/19-29848-9777DF45 for ; Mon, 09 Mar 2015 05:35:38 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 98E54E202F; Mon, 9 Mar 2015 10:35:34 +0000 (GMT) Date: Mon, 9 Mar 2015 10:35:34 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Trevor Suarez cc: PHP internals In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] [PR] DateTime::createFromImmutable() method From: derick@php.net (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 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