Re: hasType() for internal function parameters?

From: Date: Mon, 22 Jun 2015 01:55:53 +0000
Subject: Re: hasType() for internal function parameters?
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-86777@lists.php.net to get a copy of this message
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

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.internals (#86777) next »