Re: Re: POSIX 1003.1-2001 gethostname(2)
| From: | Antony Dovgal | Date: | Tue, 30 Dec 2008 15:21:35 +0000 |
| Subject: | Re: Re: POSIX 1003.1-2001 gethostname(2) | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-42410@lists.php.net to get a copy of this message | ||
On 30.12.2008 18:15, Ilia Alshanetsky wrote:
> What is the benefit of the new API, documents better, has a longer
> name, helps some fuzzing suit to determine if functions take args or
> not?
It produces much better & verbose error messages error messages.
Take a look at these for example:
5_3> ./sapi/cli/php -r 'strlen(1,2,3);'
Warning: strlen() expects exactly 1 parameter, 3 given in Command line code on line 1
5_3> ./sapi/cli/php -r 'strlen(array());'
Warning: strlen() expects parameter 1 to be string, array given in Command line code on line 1
5_2> ./sapi/cli/php -r 'strlen(1,2,3);'
Warning: Wrong parameter count for strlen() in Command line code on line 1
Notice the difference?
> Also, is this documented anywhere?
.._none() might be not documented, but it's used everywhere.
I believe it should be mentioned in README.PARAMETER_PARSING_API if it's not there yet.
--
Wbr,
Antony Dovgal