Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64322 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77198 invoked from network); 17 Dec 2012 16:48:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Dec 2012 16:48:43 -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:59489] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/C0-65234-9EC4FC05 for ; Mon, 17 Dec 2012 11:48:42 -0500 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id C9C51DE13D; Mon, 17 Dec 2012 16:48:37 +0000 (GMT) Date: Mon, 17 Dec 2012 16:48:37 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Lars Strojny cc: Herman Radtke , =?UTF-8?Q?=22=C3=81ngel_Gonz=C3=A1lez=22?= , Nikita Nefedov , "internals@lists.php.net" In-Reply-To: <4DBD0EA5-C45B-4C12-BFE9-E263B255B2C3@strojny.net> Message-ID: References: <50C63A7C.8090705@gmail.com> <4DBD0EA5-C45B-4C12-BFE9-E263B255B2C3@strojny.net> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] DateTime improvement From: derick@php.net (Derick Rethans) On Sun, 16 Dec 2012, Lars Strojny wrote: > Am 16.12.2012 um 13:21 schrieb Derick Rethans : > > > On Tue, 11 Dec 2012, Derick Rethans wrote: > > > >> On Mon, 10 Dec 2012, Herman Radtke wrote: > >> > >>> Another option is to make an ImmutableDateTime class. The DateTime > >>> class could actually be changed to inherit the ImmutableDateTime > >>> class. The only extensions on the DateTime class would be the > >>> mutable methods. > >> > >> I'm not really against that, but we do need to use the Date > >> namespace - so DateTimeImmutable. It might be trickier to do than > >> it sounds though... > > > > I've started hacking on this - with some luck I'm done before PHP > > 5.5 beta1. > This is so cool, thanks Derick! If you need help with testing or > anything else, let me know. I've just pushed it to the "immutable-date" branch: http://git.php.net/?p=php-src.git;a=shortlog;h=refs/heads/immutable-date I went for DateTimePoint. Point as in "Point in time". I am not too happy with the name, but I think it works better than DateTimeImmutable as that just sounds quircky. I'm still fixing up a few things and adding some test cases. I think I need to make it work with DatePeriod too - but I haven't looked at that yet. cheers, Derick