Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66036 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62728 invoked from network); 20 Feb 2013 09:32:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2013 09:32:14 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.113 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.113 smtp113.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.113] ([67.192.241.113:34317] helo=smtp113.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/F7-19387-C1894215 for ; Wed, 20 Feb 2013 04:32:13 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp11.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 912D2D06FE; Wed, 20 Feb 2013 04:32:09 -0500 (EST) X-Virus-Scanned: OK Received: by smtp11.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 18CA0D0575; Wed, 20 Feb 2013 04:32:09 -0500 (EST) Message-ID: <51249818.2040308@sugarcrm.com> Date: Wed, 20 Feb 2013 01:32:08 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Gustavo Lopes CC: Derick Rethans , "internals@lists.php.net" References: <1867201214.20130215192512@cypressintegrated.com> <51248C24.4070609@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Questions regarding DateTimeImmutable From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > To "accept a DateTimeImmutable" is not the same as "no recoverable > fatal error when a DateTimeImmutable is passed". You can't possibly know > whether passing a DateTimeImmutable is safe without reviewing the code > on all the call hierarchy starting from where your DateTimeImmutable is > passed. If I know what the code does with dates, I don't need to review it. > misleading statement -- it assumes codebases exist in isolation. But > current libraries that take DateTime will still be used in 5.5; in fact, > that's the basis of your whole argument for this choice. This is true. That's why I want to see what is more probable - that library accepts DateTime and would be fine with DateTimeImmutable or that library accepts DateTime and would have to be rewritten to work with DateTimeImmutable. > Here is some data: > > http://code.google.com/codesearch#search/&q=%5C$date-%3Emodify%20lang:php&type=cs&sq= > > As you can see, your assumption is false. In the majority of cases, > there is no assignment. This isn't really a good data since most of this code creates its own DateTime and thus there's very little relevancy to what we're talking about. If you look up the functions that actually accept DateTime: http://code.google.com/codesearch#search/&type=cs&q=DateTime%5Cs%5C$%20lang:%5Ephp$ the picture would be quite different. I scanned through first 5 pages and couldn't find a function that actually calls modify() on DateTime object it receives. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227