Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86777 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74985 invoked from network); 22 Jun 2015 01:56:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2015 01:56:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.220.177 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.220.177 mail-qk0-f177.google.com Received: from [209.85.220.177] ([209.85.220.177:33509] helo=mail-qk0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 32/90-04959-F2B67855 for ; Sun, 21 Jun 2015 21:56:00 -0400 Received: by qkhu186 with SMTP id u186so93592421qkh.0 for ; Sun, 21 Jun 2015 18:55:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=wlBJ/79oUJ7FG7Rwgn0iQk9/VPInSO5LKnqUjfqh2Bk=; b=ZsckMJc7oAFbmT35iUn9JcqXAfCQ8fFLHo0i9LygKKLDX2UlVusjC7rMoHBd+Ao8/J jPvFB7IQtzyUc2QGJZtaIapwalbdCr7i1ijG/lzLKpDOagqY1egs+D/yuQJUPTEbuY7V y2rPPnzzTxVp504F/dAjxy5vMt0u+NYvTZawdFohbxTEQxpCzwCNQSdkv/5G7GmdO3Se I5YYVntz/WywBxHqsLnw8lkuFuDvRzw2QMq/w586kHzay0Cs8UHly218MY6JmMFHilEK uPPM5R+HONKDKwslmtEKmjjdA4YvPg6ryHUm3I+A4M2rCVLlnDEbdNlyMRe0DsP0HoKk Bfxg== X-Gm-Message-State: ALoCoQlw2Ia6D1rjCuBnRqdDXJNxi53QwFrjz4Ce8vhUIFpnxH1TTsiPLz5TUZIXT5u0hXHy3Ka0 X-Received: by 10.140.148.67 with SMTP id 64mr36839298qhu.74.1434938156615; Sun, 21 Jun 2015 18:55:56 -0700 (PDT) Received: from [192.168.1.2] (210.sub-70-199-80.myvzw.com. [70.199.80.210]) by mx.google.com with ESMTPSA id p65sm9709911qgd.12.2015.06.21.18.55.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jun 2015 18:55:54 -0700 (PDT) Message-ID: <55876B29.90804@lerdorf.com> Date: Sun, 21 Jun 2015 21:55:53 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Stanislav Malyshev , Nikita Popov CC: Kalle Sommer Nielsen , PHP internals References: <5586E5D1.4010901@lerdorf.com> <55870947.4060304@lerdorf.com> <5587334C.2080401@lerdorf.com> <55873676.6050706@gmail.com> In-Reply-To: <55873676.6050706@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GXRcwdAR3hKt7mHHS5hqkT8CNS4alxpnn" Subject: Re: [PHP-DEV] hasType() for internal function parameters? From: rasmus@lerdorf.com (Rasmus Lerdorf) --GXRcwdAR3hKt7mHHS5hqkT8CNS4alxpnn Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/21/2015 06:11 PM, Stanislav Malyshev wrote: > Hi! >=20 >> Before making more extensive use of arginfo types, I think we should f= irst >> 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 check= s >> (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. >=20 > Agreed, for internals arginfo types should be reflection-only. I imagin= e > 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 --GXRcwdAR3hKt7mHHS5hqkT8CNS4alxpnn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlWHaykACgkQlxayKTuqOuCBtACfU4ztHqoTmJEMsgxqjkAw26qc cwEAn3SDkfyBg1onLWtpOOXIz6r7HH0v =dz6e -----END PGP SIGNATURE----- --GXRcwdAR3hKt7mHHS5hqkT8CNS4alxpnn--