Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87222 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98604 invoked from network); 21 Jul 2015 12:29:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2015 12:29:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.177 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.212.177 mail-wi0-f177.google.com Received: from [209.85.212.177] ([209.85.212.177:34425] helo=mail-wi0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9A/14-03461-E2B3EA55 for ; Tue, 21 Jul 2015 08:29:35 -0400 Received: by wibud3 with SMTP id ud3so112805711wib.1 for ; Tue, 21 Jul 2015 05:29:31 -0700 (PDT) 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=uyJPHw1KBE1cslIM0UGLIi4uNrtDC8mVoMYmXi/7t/k=; b=ESWMYFRiiboCKJ4eAYlNjDl+fprglmy9d7kRO7sq9SaAukuK5bKuBzC2/pXf5J3D2a gbk/P7hu45Bc3BXiouLg2l4ewMJUOb5due7itCcodWtaiZzcDjsN6OHmGRcQhKDmvXeq K4O/pvTtx3R0Yf9waO5ZEAkx5NFMxwgyhqzuCAcdR0cJXfli0tS4mxv6MTwjjkLSb9Y0 csqS/MJmiYOJIe3y/rpNUyx7ZP4dslD6r4G6GZGYduGnkk0BRXJ06Mas+FyaA5G/2Zpz pnOrfp55MXs1HHPGmyCc4kiqr2kTX23I54z7Nr+O58GnuLRMCZe22N6nuKC/S5ukb2aU Uc8Q== X-Received: by 10.180.36.16 with SMTP id m16mr30647395wij.26.1437481771887; Tue, 21 Jul 2015 05:29:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.49.133 with HTTP; Tue, 21 Jul 2015 05:29:12 -0700 (PDT) In-Reply-To: References: Date: Tue, 21 Jul 2015 13:29:12 +0100 Message-ID: To: Derick Rethans Cc: Niktia Nefedov , PHP Internals List Content-Type: multipart/alternative; boundary=e89a8f5035646271d6051b61ce91 Subject: Re: [PHP-DEV] DateTimeInterface is not a usable interface? From: ocramius@gmail.com (Marco Pivetta) --e89a8f5035646271d6051b61ce91 Content-Type: text/plain; charset=UTF-8 On 21 July 2015 at 12:56, Derick Rethans wrote: > On Tue, 21 Jul 2015, Marco Pivetta wrote: > > > I should also add that this breaking change was introduced in a patch > > release (5.5.8). > > That wasn't good, but I don't see how it was a *breaking* change. It > never worked before this change either. You now just told you're doing > something inappropriate. > It's an interface, it doesn't "work", it simply gets implemented (then the implementing code "works"). > > What has happened has happened, and I don't want to blame anyone, but > > this is actually really broken :-\ > > It's not a check that can be easily removed though. As Nikita says, this > all operate on internal structures. DateTimeInterface is meant so that > both DateTime and DateTimeImmutable can be type hinted for, and not > really for user land. Retrofitting PHP's DateTime stuff with user > extended classes and implementations is not going to be a trivial thing. > Then make DateTime and DateTimeImmutable only interact with DateTime and DateTimeImmutable (or child classes), but don't rely on the interface if you're not actually respecting it internally in first place, no? Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --e89a8f5035646271d6051b61ce91--