Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50861 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15619 invoked from network); 5 Dec 2010 19:36:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Dec 2010 19:36:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 178.77.98.152 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 178.77.98.152 lvps178-77-98-152.dedicated.hosteurope.de Linux 2.6 Received: from [178.77.98.152] ([178.77.98.152:40335] helo=beberlei.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/32-01246-1B9EBFC4 for ; Sun, 05 Dec 2010 14:36:18 -0500 Received: from benny-pc (koln-4d0b19f5.pool.mediaWays.net [77.11.25.245]) by beberlei.de (Postfix) with ESMTPSA id F016D6E09017; Sun, 5 Dec 2010 20:36:14 +0100 (CET) Date: Sun, 5 Dec 2010 20:36:16 +0100 To: internals@lists.php.net, smalyshev@sugarcrm.com Message-ID: <20101205203616.51a66416@benny-pc> In-Reply-To: <4CFBDA09.2020902@sugarcrm.com> References: <4CFBDA09.2020902@sugarcrm.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Patch: Marking DateTime Instances Immutable From: kontakt@beberlei.de (Benjamin Eberlei) On Sun, 05 Dec 2010 10:29:29 -0800 Stas Malyshev wrote: > Hi! > > > I propose to allow to work with DateTime objects that are marked as > > immutable optionally. This means that all methods add, sub, modify, > > I think it's a bad idea, which would instantly break all the code that > assumes different semantics. Yes, I noticed the word optional, however, > the code accepting DateTime assumes some semantics, and had no means to > reject object with different semantics, and combining two semantics in > one class is a bad idea. > > On the other hand, you can create DateTimeValue object, which can do > what you want. I'd imagine it'd be quite easy to do in user space too. > If enough people feel they need it then it can be brought into the > extension too. Hey Stas, i actually implemented this in userland, but its rather ugly: http://whitewashing.de/blog/124 I'd like to see it in the extension, the patch was just the only thing i could do with my limited C skills ;-) It is better to start the discussion with something visible rather than just speaking about hypothetical changes :-) > > > I also talked to Derick about this and he agrees that immutable DateTime > > objects would be desirable. I have talked to many other people who agreed > > that the current behavior is weird. > > I've talked to many people who agree it isn't ;) > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >