Re: svn: /php/php-src/trunk/ext/standard/ basic_functions.c streamsfuncs.c streamsfuncs.h var_unserializer.c
| From: | Johannes Schlüter | Date: | Mon, 12 Apr 2010 10:18:42 +0000 |
| Subject: | Re: svn: /php/php-src/trunk/ext/standard/ basic_functions.c streamsfuncs.c streamsfuncs.h var_unserializer.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-62240@lists.php.net to get a copy of this message | ||
Hi,
On Mon, 2010-04-12 at 08:25 +0000, Pierre Joye wrote:
> - switch (ZEND_NUM_ARGS()) {
> - case 2:
> - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2)
> == FAILURE) {
> - RETURN_FALSE;
> - }
> - break;
> - default:
> - WRONG_PARAM_COUNT;
> - /* NOTREACHED */
> - break;
> + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) ==
> FAILURE) {
> + RETURN_FALSE;
> }
This is a small change to the behavior: With the old code it would have
returned NULL on wrong param count and FALSE in case the parsing failed,
with the new code it returns FALSE in both cases.
I'd prefer NULL in both cases as that's how we react usually (see
<http://php.net/functions.internal>)
Doubt it makes any difference in real life though.
Other than that: No test case possible for this new function?
johannes