mirror of
https://github.com/php/php-src.git
synced 2026-03-28 10:12:18 +01:00
Fixed ext/pdo_*/tests/pdo_005.phpt tests failure
This commit is contained in:
@@ -3484,9 +3484,10 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, int param_count
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC) /* {{{ */
|
||||
ZEND_API int zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zval *arg, *params;
|
||||
int n = 1;
|
||||
|
||||
zend_fcall_info_args_clear(fci, !args);
|
||||
|
||||
@@ -3502,14 +3503,28 @@ ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC) /*
|
||||
fci->params = params = (zval *) erealloc(fci->params, fci->param_count * sizeof(zval));
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(args), arg) {
|
||||
ZVAL_COPY(params, arg);
|
||||
if (func && !Z_ISREF_P(arg) && ARG_SHOULD_BE_SENT_BY_REF(func, n)) {
|
||||
ZVAL_NEW_REF(params, arg);
|
||||
if (Z_REFCOUNTED_P(arg)) {
|
||||
Z_ADDREF_P(arg);
|
||||
}
|
||||
} else {
|
||||
ZVAL_COPY(params, arg);
|
||||
}
|
||||
params++;
|
||||
n++;
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return zend_fcall_info_args_ex(fci, NULL, args TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci TSRMLS_DC, int argc, zval *argv) /* {{{ */
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -491,6 +491,7 @@ ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, int param_count
|
||||
* refcount. If args is NULL and arguments are set then those are cleared.
|
||||
*/
|
||||
ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC);
|
||||
ZEND_API int zend_fcall_info_args_ex(zend_fcall_info *fci, zend_function *func, zval *args TSRMLS_DC);
|
||||
|
||||
/** Set arguments in the zend_fcall_info struct taking care of refcount.
|
||||
* If argc is 0 the arguments which are set will be cleared, else pass
|
||||
|
||||
@@ -748,7 +748,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
|
||||
fci->params = NULL;
|
||||
fci->no_separation = 1;
|
||||
|
||||
zend_fcall_info_args(fci, &stmt->fetch.cls.ctor_args TSRMLS_CC);
|
||||
zend_fcall_info_args_ex(fci, ce->constructor, &stmt->fetch.cls.ctor_args TSRMLS_CC);
|
||||
|
||||
fcc->initialized = 1;
|
||||
fcc->function_handler = ce->constructor;
|
||||
|
||||
Reference in New Issue
Block a user