Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77412 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11750 invoked from network); 21 Sep 2014 09:59:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2014 09:59:17 -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.213.178 cause and error) X-PHP-List-Original-Sender: florian@margaine.com X-Host-Fingerprint: 209.85.213.178 mail-ig0-f178.google.com Received: from [209.85.213.178] ([209.85.213.178:60252] helo=mail-ig0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/F0-03322-471AE145 for ; Sun, 21 Sep 2014 05:59:17 -0400 Received: by mail-ig0-f178.google.com with SMTP id r10so1270549igi.11 for ; Sun, 21 Sep 2014 02:59:14 -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:from:date:message-id:subject:to :content-type; bh=gXAwxC/jAvAggV4aT1n4kgnf+8CHRnh52N9TLaqgXWQ=; b=I18L7OwFIzwHaJi1YeGK9uobSZiKzzNXRjfdNYkzVzsNmXy6FbdTpoQNfe8Fvm7wo1 PCkmX1tseC1RCDMTOmjcGOHPgKLU2KOXKZeNb8vbvHsW70YM9LRSzC5+ckG3LoJEkHHR ZcBOXcMZLIF9baRni53kE44Mm/p87aTU5r2EFy8vQQhacUlGwiFPwtew7L7MGtGkCSEB mMAyVGqS0t2w8+mGb5jrdl+uW4hQK7iEPfagBji5uGKwqTqQ36mkn8A8DBpj2/W8MVo+ 6zdWXyjqki51Kv898RdqXruVKPnShc/X315eQ58scHXzDJYUwd56haKHsRme4u9ASJzM RwwA== X-Gm-Message-State: ALoCoQmy64NvbOLRmcF7h8fFdR8mWxb05YQdqpdwCeF5fBmFI0ZD0Apm8KByUCiiRxCmdHYdL5JO X-Received: by 10.43.158.195 with SMTP id lv3mr10612667icc.30.1411293554281; Sun, 21 Sep 2014 02:59:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.41.20 with HTTP; Sun, 21 Sep 2014 02:58:54 -0700 (PDT) X-Originating-IP: [89.92.205.106] Date: Sun, 21 Sep 2014 11:58:54 +0200 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001a11c2492cfa25b2050390624c Subject: ext/date arguments handling From: florian@margaine.com (Florian Margaine) --001a11c2492cfa25b2050390624c Content-Type: text/plain; charset=UTF-8 Hi list, 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. In my opinion, using ZEND_ARG_OBJ_INFO means that we're going to the right direction: fixing the type hints and the reflection of the classes. The PR could be backported to 5.* by using ZEND_ARG_INFO to avoid BC breaks. Regards, *Florian Margaine* --001a11c2492cfa25b2050390624c--