Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64245 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38827 invoked from network); 11 Dec 2012 01:39:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2012 01:39:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.123 smtp123.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.123] ([67.192.241.123:45561] helo=smtp123.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/43-16251-1EE86C05 for ; Mon, 10 Dec 2012 20:39:45 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp12.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id E157F3C0255; Mon, 10 Dec 2012 20:39:42 -0500 (EST) X-Virus-Scanned: OK Received: by smtp12.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 97C333C0196; Mon, 10 Dec 2012 20:39:42 -0500 (EST) Message-ID: <50C68EDE.7000409@sugarcrm.com> Date: Mon, 10 Dec 2012 17:39:42 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Christian Stoller CC: "internals@lists.php.net" References: <4ED7146272E04A47B986ED49E771E347BB362B68DE@Ikarus.ameusgmbh.intern> In-Reply-To: <4ED7146272E04A47B986ED49E771E347BB362B68DE@Ikarus.ameusgmbh.intern> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Improve DateTime Class From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > what do you think about improving the modification functionality of the DateTime class. I always get a cold shiver, when I write something like this: > $date = new DateTime() > $date->modify(‘+15 day’); > > In my opinion it would be nicer if one could write: > $date->modify(15, DateTime::INTERVAL_DAY); // for adding 15 days > $date->modify(-15, DateTime::INTERVAL_DAY); // for subtracting 15 days I think there's a very low value in a new API that does exactly what existing API does but in slightly different way because of tastes of some particular person. If you want to add something that is not possible with existing API, it is welcome (given RFC, etc.) but just adding small variations on the same theme would only add confusion and if needed, can be very easily implemented in userspace. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227