Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64234 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9883 invoked from network); 10 Dec 2012 19:46:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2012 19:46:44 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:64855] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/48-60401-32C36C05 for ; Mon, 10 Dec 2012 14:46:44 -0500 Received: by mail-we0-f170.google.com with SMTP id r1so1467755wey.29 for ; Mon, 10 Dec 2012 11:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=mrsAAQlwCHjALVrckns4MEWzy3gAUeIP6SyMkfAO5mg=; b=IOt+eQtem451a1hrzp0Xo3v3ticj9e4A8vI4nGrrCJ5QB+W8sdVlOfK3ukURBEjlGP XFg0tCElxvvPCPjoI2FbXTxio8p3xl3unt3iIYLvhalrgebKAZ0LIJaGVG/+QUclobxc /dkr71P+6NfcdSnU09No+6JUSy0P0yM4DrV6a5OUQIKMN5S9rEbi8r+VTLWXuiGCwLe7 sDZ3eGgx6FvntpF4aE6+pzuE0zJFHs90ibdQtJ1jYwLR/PrlJUwuRfWocbzLYuZWA6os PDNGapgj7SRlR7CqYh5FyFlD0TYmzl2zB6qWdIk3RIeKv1MzYvtN6CVO0GmLmFVSKV1S 0Miw== Received: by 10.180.87.225 with SMTP id bb1mr12761570wib.20.1355168801179; Mon, 10 Dec 2012 11:46:41 -0800 (PST) Received: from [192.168.1.26] (54.Red-83-55-231.dynamicIP.rima-tde.net. [83.55.231.54]) by mx.google.com with ESMTPS id dm3sm11407227wib.9.2012.12.10.11.46.39 (version=SSLv3 cipher=OTHER); Mon, 10 Dec 2012 11:46:40 -0800 (PST) Message-ID: <50C63BAD.10101@gmail.com> Date: Mon, 10 Dec 2012 20:44:45 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Christian Stoller CC: Sebastian Krebs , Marco Pivetta , Nikita Nefedov , "internals@lists.php.net" References: <4ED7146272E04A47B986ED49E771E347BB362B68DE@Ikarus.ameusgmbh.intern> <4ED7146272E04A47B986ED49E771E347BB362B68E4@Ikarus.ameusgmbh.intern> In-Reply-To: <4ED7146272E04A47B986ED49E771E347BB362B68E4@Ikarus.ameusgmbh.intern> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Improve DateTime Class From: keisial@gmail.com (=?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?=) On 10/12/12 13:35, Christian Stoller wrote: > Hm... I know '$date->add(new DateInterval('P15D'));' is possible, but it has the same problem. > > I have to write: > > $date = new DateTime() > $date->add(new DateInterval('P' . getDaysToAddMethod() . 'D')); > > I think it is very hard to read. Or is it just my personal point of view? I agree it's unintuitive. Rather than the original: $date->modify(15, DateTime::INTERVAL_DAY); What about adding such option to DateInterval constructor? new DateInterval(DateTime::INTERVAL_DAY, 15); Or maybe: new DateInterval( array( DateTime::INTERVAL_DAY=> 15 ) );