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
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php