Re: DateTime improvement

From: Date: Mon, 17 Dec 2012 16:48:37 +0000
Subject: Re: DateTime improvement
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Sun, 16 Dec 2012, Lars Strojny wrote:

> Am 16.12.2012 um 13:21 schrieb Derick Rethans <[email protected]>:
> 
> > 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


Thread (34 messages)

« previous php.internals (#64322) next »