Re: DateTime improvement

From: Date: Tue, 11 Dec 2012 17:06:05 +0000
Subject: Re: DateTime improvement
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi!

> As Nikita says, from an ORM perspective, an object is always immutable
> (at least with current implementations I know of), and that's because
> they can simply use the object hashes to identify two different objects.

Why for ORM Date is even an object? In most databases, date is a basic
value type, and should be accepted by value, not as a complex object.
So, it should also be identified as the value - for number 1, you do not
need additional identity or hash except it being number 1, same should
be for dates.

> I don't believe (at all) in "if you don't need it mutable, don't use
> modify() oroverride modify()". If the API is there, people will use it.
> We tried to implement an immutable DateTime in userland, but it doesn't
> work out well...

Why it doesn't work well and why PHP needs to be changed because of it?
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227


Thread (34 messages)

« previous php.internals (#64258) next »