Hi!

So I tried to remove the checks for ZEND_ACC_HAS_TYPE_HINTS:
https://github.com/php/php-src/pull/1354

Turns out there is a lot of tests that assume function with wrong
arguments throws Error, but ZPP and type checks work differently - ZPP
first checks argument number (and doesn't throw if number is wrong but
instead creates warning), while type checks (that shouldn't really
happen on internals but do) check types first and not check argument number.

So I wonder which way is the best to proceed here. Looks like this comes
from 5.6 where internal function types were verified in executor:
https://github.com/php/php-src/blob/PHP-5.6/Zend/zend_vm_def.h#L1974

I'm not sure what to do with it - on one side, I think ZPP should handle
it for internal functions, otherwise we're doing the same work twice. On
the other side, that would be pretty substantial, even if maybe correct,
BC break. Should we keep the ZEND_ACC_HAS_TYPE_HINTS type checks and
accept the fact that this way we're checking everything twice, or should
be clean it up?

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to