Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50858 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4670 invoked from network); 5 Dec 2010 18:29:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Dec 2010 18:29:33 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.153 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.153 smtp153.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.153] ([67.192.241.153:33687] helo=smtp153.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/80-01246-C0ADBFC4 for ; Sun, 05 Dec 2010 13:29:33 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp5.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 6FD8C5808E; Sun, 5 Dec 2010 13:29:30 -0500 (EST) X-Virus-Scanned: OK Received: by smtp5.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 258DB58033; Sun, 5 Dec 2010 13:29:29 -0500 (EST) Message-ID: <4CFBDA09.2020902@sugarcrm.com> Date: Sun, 05 Dec 2010 10:29:29 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Benjamin Eberlei CC: "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Patch: Marking DateTime Instances Immutable From: smalyshev@sugarcrm.com (Stas Malyshev) 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. > 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