Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66855 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85885 invoked from network); 29 Mar 2013 09:35:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Mar 2013 09:35:05 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:47027] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/72-02462-84065515 for ; Fri, 29 Mar 2013 04:35:05 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 582A6DE14D; Fri, 29 Mar 2013 09:35:01 +0000 (GMT) Date: Fri, 29 Mar 2013 09:35:01 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Jordi Boggiano cc: internals@lists.php.net In-Reply-To: <5152E8EA.8040701@seld.be> Message-ID: References: <5152E8EA.8040701@seld.be> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] DateTimeImmutable From: derick@php.net (Derick Rethans) On Wed, 27 Mar 2013, Jordi Boggiano wrote: > On 27.03.2013 13:18, Lars Strojny wrote: > > > Not really, as an interface guarantees behavior, which is not > > possible for DateTimeImmutable and DateTime. > > The interface could be a subset of DateTime public methods, including > only the readonly ones. > > I can't imagine how this could possibly be named in a sane way though :/ Name aside, an interface is sort of very useful otherwise we're ending up with code like this all over the time: first_arg_ce = zend_get_class_entry(start); if ((first_arg_ce != date_ce_date) && (first_arg_ce != date_ce_immutable)) { And that's a real pain, so an interface for just the gettings (and other methods not modifying/changing anything is probably a good idea. I'll see if I can work on this over the Easter weekend. cheers, Derick