[PR][php-src][#1108][master] - RFC: Strict Arg Count On Function Calls

From: Date: Sun, 22 Feb 2015 00:35:35 +0000
Subject: [PR][php-src][#1108][master] - RFC: Strict Arg Count On Function Calls
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-2423@lists.php.net to get a copy of this message
You can view the Pull Request on github: https://github.com/php/php-src/pull/1108 Pull Request Description: RFC: [Strict Arg Count On Function Calls](https://wiki.php.net/rfc/strict_argcount) Ex: ```php function fn($arg) { // 1 arg expected } fn(1, 2, 3); # Warning: fn() expects at most 1 parameter, 3 given, defined in %s on line 2 and called... ``` The implementation is sensible to func_get_arg(), func_get_args() and func_num_args() usage. It means that if a function|method is implemented using the variable-length arg list API, the warning is not emitted: ```php function fn($arg) { $arg = func_get_arg(); $args = func_get_args(); $argcount = func_num_args(); } fn(1, 2, 3); # no warning ``` PS: Some unrelated tests have to be fixed.

« previous php.git-pulls (#2423) next »