Hi Matteo 2009/4/1 Matteo Beccati <p...@beccati.com>: > Hi, > >> After a quick discussion with Lukas and Antony on IRC, I wrote a small >> script to detect how many functions/methods are returning false after >> failing to validate the arguments: you 'll find the result for PHP_5_3 >> attached. >> >> The regex I've used is not perfect, but if you think it's somewhat >> accurate we might want to decide fixing in PHP 5.3 as there aren't many >> places that need to be fixed. > > I don't mean to stress you on this, it's not too bad if we don't fix it. > > But I'd just need a suggestion on what to do within the pdo extension as I'm > supposed to commit a fix for PDO::query() and PDO::setFetchMode() to make > argument validation more strict and those methods are among the ones that > return false when argument checks fail. > > You'll find a patch for the entire 5.3 php-src, in case you want to take a > look: > http://www.beccati.com/misc/php/zend_parse_params_return_false.diff
Most of php-src uses validation check the other way around: if (zend_parse_parameters(...) == FAILURE) { ... } But I still don't agree that we should change to return false if parameter parsing fails, in most cases it generates a verbal warning which no one want in first place with this new API which should make people awake of their code is wrong. Ofcourse theres the quite option, but still > > > Cheers > -- > Matteo Beccati > > OpenX - http://www.openx.org > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Kalle Sommer Nielsen ka...@php.net -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php