[PR][php-src][#1108][master] - RFC: Strict Arg Count On Function Calls
| From: | noreply@php.net | Date: | Sat, 21 Feb 2015 04:13:59 +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-2417@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
The implementation is sensible to
func_num_arg(), func_get_args() and
func_num_args() usage. Ex:
```php
function fn($arg) {
// 1 arg expected
}
fn(1, 2, 3);
# Warning: Exceeding argument count 3 passed for fn(), expected 1, called on % defined...
```
If function|method is implemented with dynamic arg count, the warning is
not emitted:
```php
function fn($arg) {
$args = func_get_args();
//...
}
fn(1, 2, 3); # no warning
```
PS: Some unrelated tests had to be fixed.