Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86780 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4324 invoked from network); 22 Jun 2015 09:11:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2015 09:11:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.216.54 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.216.54 mail-vn0-f54.google.com Received: from [209.85.216.54] ([209.85.216.54:41082] helo=mail-vn0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A8/12-11444-F31D7855 for ; Mon, 22 Jun 2015 05:11:27 -0400 Received: by vnav203 with SMTP id v203so3536828vna.8 for ; Mon, 22 Jun 2015 02:11:24 -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:date :message-id:subject:from:to:cc:content-type; bh=SBDSgKgIv+ThcT6AyaubO5iCbJc2xPBfBCOPjUNYyWo=; b=lO6Gvmm37viqbDFkm0SGSqoA4KrnEj5RnXpnAfWgoJETEgtzFpnNE8KWKz0JGLWUOR bfOymkcuYX3JMVYkoanIEaHiPnB1Ym95e9zop4lVQzKFp2qkD3Swr+5TTKB4B2zbx55P B/xlQHm87bn2ZM8FoWOakmzbHzv646w5tefHucViqXHnfElQmmWSuch48/ZK8JskAGD6 FFcFTfhGjdLPtMvEoslPP87DZ5cGzOnXyn/+mTBr40rCL32rP3A9MJgcb+Vgjh8O/Fr7 e40/ZfH7Xs5LrqZmyCOBEHWZPega1zkiej9uM+oMc94ZNk1pVgu/w2rG8DgDHjjznrQH ixaA== X-Gm-Message-State: ALoCoQm2KH8ME0WZcAtDC4oeLwlpV0N9x57OTfj9g2lKqcOxG/SnILfwjzuYpze0blEMmVQcXDE0CVIJdEjjlyrwntRtAl/7iULvj4RRjyrqSF+VOCn/mHobK2tPYFe6IjghPrfgdsBiSPLhheo3Jt+d/Vm15hX/bk80K2R6lYgu3mW+ezdxtWU= MIME-Version: 1.0 X-Received: by 10.53.0.226 with SMTP id bb2mr18109244vdd.4.1434964283953; Mon, 22 Jun 2015 02:11:23 -0700 (PDT) Received: by 10.31.10.201 with HTTP; Mon, 22 Jun 2015 02:11:23 -0700 (PDT) In-Reply-To: <55876B29.90804@lerdorf.com> References: <5586E5D1.4010901@lerdorf.com> <55870947.4060304@lerdorf.com> <5587334C.2080401@lerdorf.com> <55873676.6050706@gmail.com> <55876B29.90804@lerdorf.com> Date: Mon, 22 Jun 2015 12:11:23 +0300 Message-ID: To: Rasmus Lerdorf , Bob Weinand , Anatol Belski , Kalle Sommer Nielsen Cc: Stanislav Malyshev , Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=001a1134c6e6696ae0051917a823 Subject: Re: [PHP-DEV] hasType() for internal function parameters? From: dmitry@zend.com (Dmitry Stogov) --001a1134c6e6696ae0051917a823 Content-Type: text/plain; charset=UTF-8 Hi Rasmus, Your latest changes broke more than 100 tests. Sorry, but I had to revert your commits and related Bob's fixes. You may find them in internal-arg-info branch. Please, don't do experiments on the common code base at beta stage. On the other hand, I don't see a big problem committing this, when a complete solution is ready. Thanks. Dmitry. On Mon, Jun 22, 2015 at 4:55 AM, Rasmus Lerdorf wrote: > On 06/21/2015 06:11 PM, Stanislav Malyshev wrote: > > Hi! > > > >> Before making more extensive use of arginfo types, I think we should > first > >> do some adjustments to the way they are handled. In particular adding > types > >> means that internal fcalls will take the branch in > >> http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_vm_def.h#3669. As this is > hot > >> code, it is likely important to avoid doing those duplicate type checks > >> (that will also happen in zpp anyway). As such I would suggest to make > >> arginfo for internal functions reflection-only. Return type hints are > >> already only enforced in debug mode. > > > > Agreed, for internals arginfo types should be reflection-only. I imagine > > that would be very easy to fix just by checking for function type? > > Ok, I have fixed the arginfo for all the built-in engine functions. > I wrote a little script which generates it from the doc-comments in the > code. I think the easiest way to do it is to first go through the file > and check the "{{{ proto" comments to make sure the optional args are > denoted correctly and no args are missing. > > To run it: > > script/dev/genarginfo.php Zend/zend_builtin_functions.c > > for example. > > -Rasmus > > --001a1134c6e6696ae0051917a823--