Re: Re: POSIX 1003.1-2001 gethostname(2)

From: Date: Tue, 30 Dec 2008 15:44:12 +0000
Subject: Re: Re: POSIX 1003.1-2001 gethostname(2)
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-42411@lists.php.net to get a copy of this message
On 30-Dec-08, at 10:21 AM, Antony Dovgal wrote:
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?
Cool, that's a good change, I'll keep it mind for future code.
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.
Yes, that would be helpful to have in there. Ilia Alshanetsky

« previous php.internals (#42411) next »