Re: RFC idea: using the void type to control maximum arity of user-defined functions
| From: | Pablo Rauzy | Date: | Thu, 04 Apr 2024 13:19:51 +0000 |
| Subject: | Re: RFC idea: using the void type to control maximum arity of user-defined functions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122931@lists.php.net to get a copy of this message | ||
Hello Kamil,
Le 04/04/2024 à 15:10, Kamil Tekiela a écrit :
Interesting proposal, but immediately I have two questions: 1. Why is passing extra arguments a problem at all? Is generating a warning a good idea? If you would like to introduce a new syntax to enforce non-variadic functions, shouldn't it be a runtime error then? Generating a warning makes it look like the new syntax still allows for variadic arguments, but passing the extra arguments now is somehow a bad thing to do. 2. How does this affect func_get_args()? Will the function stop working or continue working as before?1. Indeed, if implemented it should be an error rather than a warning, you're right. 2. I don't see why func_get_args() should work differently, but that maybe my lack of knowledge of the internals of PHP. In any case I think it would be better if it worked the same. Regards, -- Pablo