Re: [PHP-LANG] Feature or bug?
[email protected] ("Jeroen van Wolffelaar") Wed, 31 Oct 2001 15:30:33 +0100
| Newsgroups | php.dev,php.lang |
|---|---|
| Message-ID | <016901c16218$eb8fc6d0$0400000a@giga> |
Yasuo wrote:
> PHP does not report any errors for too many parameters for user
> defined functions, both normal function and class method :(
>
> Is PHP designed not to report error for this?
> Too many parameters for a function is obvious error and any
> language MUST report error for this, unless variable length of
> parameters is allowed. IMO
php.lang is for language documumentation. Use php-dev for this kind of
issues.
And yes, that is intended. You need it when you do you own argument
handling:
function printall()
{
foreach (function_get_args() as $arg) {
echo "$arg\n";
}
}
--Jeroen