Re: hasType() for internal function parameters?

From: Date: Sun, 21 Jun 2015 18:58:15 +0000
Subject: Re: hasType() for internal function parameters?
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-86770@lists.php.net to get a copy of this message
On 06/21/2015 02:44 PM, Nikita Popov wrote: > The difference here is that ustrlen() has an argument type specified in > arginfo, while strlen() triggers an error through > zend_parse_parameters(). We have practically no arginfo-level type > annotations in the standard library. Obviously we can't look into a function to check what it is passing to ZPP, but maybe ZPP could be made smarter and have it fill in the arginfo if it isn't there. That sounds slow though. Or we bite the bullet and fix the arginfo everywhere to make it consistent. It wouldn't be that hard to write a script to generate the bulk of it. I just don't like the fact that a parameter can raise a type error when it claims to not have a type. It makes writing static analysis and other type checking tools much more complicated. -Rasmus

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