Skip to content

Conversation

@divinity76
Copy link
Contributor

For example strlen(); generates ArgumentCountError and is not a user-defined function.

For example strlen(); generates ArgumentCountError and is not a user-defined function.
@cmb69
Copy link
Member

cmb69 commented Dec 31, 2022

Thank you! Unfortunately, it is not as simple as that. ArgumentCountErrors are thrown for internal function only as of PHP 8.0.0, and not only when too few arguments were passed, but also when too many arguments were given. Prior to that version, both cases raised E_WARNING instead.

For userland functions, ArgumentCountError is thrown for too few arguments as of PHP 7.1.0 (previously, E_WARNING was raised instead). Excess arguments to userland functions are still ignored (to cater to func_get_args() and friends).

I think we should be precise here. :)

@divinity76
Copy link
Contributor Author

divinity76 commented Dec 31, 2022

@cmb69 fixed, please re-read it

(edit: quote "only as of PHP 8.0.0," - well PHP7 is EOL so we shouldn't waste effort on PHP7)

@cmb69
Copy link
Member

cmb69 commented Dec 31, 2022

well PHP7 is EOL so we shouldn't waste effort on PHP7

The manual is still supposed to document PHP 7.0.0 - 8.2.x. There is no need to describe the PHP 7 behavior in the description text, but there should be changelog entries added (see how that's done for Throwable).

And it is important to note that

Excess arguments to userland functions are still ignored

@mumumu
Copy link
Member

mumumu commented Aug 8, 2023

@Girgias This PR is already redundant?

refs: #2654

@Girgias
Copy link
Member

Girgias commented Aug 9, 2023

Indeed, didn't see that. GitHub is very annoying with how it sometimes doesn't link issues...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants