Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64249 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69961 invoked from network); 11 Dec 2012 09:09:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Dec 2012 09:09:09 -0000 Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.170 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.223.170 mail-ie0-f170.google.com Received: from [209.85.223.170] ([209.85.223.170:45689] helo=mail-ie0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/92-54245-438F6C05 for ; Tue, 11 Dec 2012 04:09:08 -0500 Received: by mail-ie0-f170.google.com with SMTP id k10so12461713iea.29 for ; Tue, 11 Dec 2012 01:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=CleYA7JbO4qbTwh/T7J6yvT35qQXUm8m9C0F4oe74N4=; b=fh3+AQDM7gLEYhlM0IQhzy76nHDVDuNdAPLof5Z7DHHT9cTq5Xd0O8rSBoLsYn7xio XjZqVWcNtpAnZ9G95ze+tLnL4ihphNZVfL54MzVtHBv8dVJ/wv8bmJRbmL5veNVPCIi/ jB2Q1aZe02BCI+3cJ7qfIfLh2kWgzx2yb+tkBDRfwBiZad2FusTu9zVmhaZtOUsHm+jZ IRr1ec2t3c3dTuN8tdQVPXYa1elCulaqE5+8LyG14PWndG3rSlYa5Dre3bBJtdtEfPmn zFguYGgIrlddOSTC7UOHwS3JmOQJz+ggJs4dRjDTL9/prGBN4G2rOlkQfVH3ooaPdzNY yVdw== Received: by 10.42.32.200 with SMTP id f8mr738335icd.18.1355216945819; Tue, 11 Dec 2012 01:09:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.136.81 with HTTP; Tue, 11 Dec 2012 01:08:45 -0800 (PST) In-Reply-To: References: <50C69191.5020201@sugarcrm.com> Date: Tue, 11 Dec 2012 10:08:45 +0100 Message-ID: To: Nikita Nefedov Cc: Stas Malyshev , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=bcaec5186646a62ea304d09008d2 Subject: Re: [PHP-DEV] DateTime improvement From: ocramius@gmail.com (Marco Pivetta) --bcaec5186646a62ea304d09008d2 Content-Type: text/plain; charset=UTF-8 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. While this may be a niche to many of you, I've encountered a quite big amount of people just modifying their DateTime objects with the existing API and then complaining about their date not being saved to DB. 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... Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --bcaec5186646a62ea304d09008d2--