On 02.07.2018 at 23:16, Nikita Popov wrote: > On Mon, Jul 2, 2018 at 11:00 PM, Christoph M. Becker <cmbecke...@gmx.de> > wrote: > >> Is there any particular reason why internal functions raise a warning/an >> error regarding excess arguments, unless they are not supposed to >> receive any arguments at all? In other words, why don't we use >> ZEND_PARSE_PARAMETERS_NONE() (except for net_get_interfaces())? > > The more common macro for this is zend_parse_parameters_none(), which a > quick grep shows to be used by 519 functions. If a function accepts no > arguments and does not use zend_parse_parameters_none(), that's generally a > bug.
Ah, thanks! I couldn't find zend_parse_parameters_none() in README.PARAMETER_PARSING_API[1] – guess it should be added there. Anyhow, I've noticed this due to bug 33502[2], and indeed for output_reset_rewrite_vars()[3] there is still no ZPP in place. Then I've checked func_num_args()[4] (which just came to mind), and found that it doesn't do any ZPP either, as well as other parameterless functions defined immediately before it. Should these (and other occurences, if there are any) be fixed for PHP-7.1, or for master only? I'm somewhat concerned regarding the potential BC break, particularly with strict_types. [1] <https://github.com/php/php-src/blob/a7028d96719fef1939eb3bf14ddb05491ef4e09f/README.PARAMETER_PARSING_API> [2] <https://bugs.php.net/bug.php?id=33502> [3] <https://github.com/php/php-src/blob/f2c4f06f84fd3a9fbb241dd84179eaa591f196a4/main/output.c#L1542-L1552> [4] <https://github.com/php/php-src/blob/2543e61aed67add7522e0b4cdf9a13cf3e441f6f/Zend/zend_builtin_functions.c> -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php