Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77458 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38384 invoked from network); 22 Sep 2014 11:58:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Sep 2014 11:58:57 -0000 Authentication-Results: pb1.pair.com header.from=florian@margaine.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=florian@margaine.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain margaine.com from 209.85.223.174 cause and error) X-PHP-List-Original-Sender: florian@margaine.com X-Host-Fingerprint: 209.85.223.174 mail-ie0-f174.google.com Received: from [209.85.223.174] ([209.85.223.174:61385] helo=mail-ie0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CE/51-31799-00F00245 for ; Mon, 22 Sep 2014 07:58:56 -0400 Received: by mail-ie0-f174.google.com with SMTP id rd18so1906028iec.33 for ; Mon, 22 Sep 2014 04:58:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=YGXNBdekqNb8+XDQFFjbpZKeuSXN2m1JAoy1OYyo7i0=; b=ATMaLiIP7byhPMTk4N/hFmAUuv8dS5GxLmNHZVnlsSWeDMFJjQKE3otTkrkV3GHm1g jowj5qw2yxUdwv8IDvy5PSLDKEp3Mw5v154C29k/d6O9lWOGOIpKvk9eLRl09cERLRDp o/fT0dBXy74GsdmQj2bMVkhr73hXc8ejrRPYSLTXypRfZyc2aKUyPp03/n/cPdeV1znH xY9FqWf82Kaum2LKmPKZxYgQED9s/umTQk6E88YOtiu4+yQDAyZcMbX7P0MI8N9lFmBO gzJpwaq/mz0164Wvoum+0Hw1cTGQxQvU6qFpn4M0etm3/eGff6xIzDD5G2gKSGVHxm5c cRIQ== X-Gm-Message-State: ALoCoQl3Ts2arAWsXd7euGc4P5wSS0547KjlcwsXZJhPFNZbiPvKxp2tIQT4T4P4pKb/Y9q3RjKJ X-Received: by 10.51.17.2 with SMTP id ga2mr13780291igd.12.1411387133234; Mon, 22 Sep 2014 04:58:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.41.20 with HTTP; Mon, 22 Sep 2014 04:58:33 -0700 (PDT) X-Originating-IP: [82.247.184.175] In-Reply-To: References: Date: Mon, 22 Sep 2014 13:58:33 +0200 Message-ID: To: Derick Rethans Cc: PHP Developers Mailing List Content-Type: multipart/alternative; boundary=001a113491e4b7aa190503a62c79 Subject: Re: [PHP-DEV] ext/date arguments handling From: florian@margaine.com (Florian Margaine) --001a113491e4b7aa190503a62c79 Content-Type: text/plain; charset=UTF-8 Hi Derick, Thanks for your answer! Indeed, I did plan on doing another PR for 5.6 while keeping ZEND_ARG_INFO. I'll review your notes and take care of them. Regards, *Florian Margaine* On Mon, Sep 22, 2014 at 1:29 PM, Derick Rethans wrote: > Hi Florian, > > On Sun, 21 Sep 2014, Florian Margaine wrote: > > > I specifically mean to ask @derick about this issue I'm having, since > > he is the maintainer of ext/date. > > > > I wrote this pull request for the DateTimeZone::getOffset method to > > accept a DateTimeInterface instead of a DateTime object: > > https://github.com/php/php-src/pull/831 > > > > Instead of using ZEND_ARG_INFO, I use ZEND_ARG_OBJ_INFO rather than > > relying on zpp only. It makes the code consistent with the type > > hinting errors that should arise, and also gives a correct reflection. > > > > However, the rest of the code in this extension uses ZEND_ARG_INFO, > > only throwing warnings when the arguments are not of the right kind. > > > > Should I use ZEND_ARG_INFO and rely on zpp's warning, or should I use > > ZEND_ARG_OBJ_INFO, and eventually translate the other methods to use > > it too? This'd be out of this PR of course, but it makes sense to > > streamline the methods of ext/date. > > I think it should use ZEND_ARG_OBJ_INFO. However, I am not sure whether > we can do that in 5.x because of BC reasons. It's these tiny mistakes > that are the larger BC problems. So I would suggest that you make a PR > for 5.6 without ZEND_ARG_OBJ_INFO, and one for 7 with ZEND_ARG_OBJ_INFO. > > I think the patch looks mostly good too. I would recommend you squash > the commits into a single commit though. > > cheers, > Derick > --001a113491e4b7aa190503a62c79--