summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2014-04-10 16:49:13 +0300
committerAndrey Hristov <andrey@php.net>2014-04-10 16:49:13 +0300
commit090c3e87c0449e6eadf83815bb57c8a6eff4b56e (patch)
tree946fdc55ed17d2dc07a99b388565cc96197026dd /ext/mysqli/mysqli.c
parent63791d055ad64762c3f63e08ca7ad8ba1f44e0ab (diff)
parent3204ad5858a5abc50b11b8527d22c82eb07a80cc (diff)
downloadphp-git-090c3e87c0449e6eadf83815bb57c8a6eff4b56e.tar.gz
Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
Conflicts: ext/mysqli/tests/mysqli_begin_transaction.phpt
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r--ext/mysqli/mysqli.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 120c194964..b23d7e3139 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -1297,19 +1297,12 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
fci.symbol_table = NULL;
fci.object_ptr = return_value;
fci.retval_ptr_ptr = &retval_ptr;
+ fci.params = NULL;
+ fci.param_count = 0;
+ fci.no_separation = 1;
+
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
- if (Z_TYPE_P(ctor_params) == IS_ARRAY) {
- HashTable *params_ht = Z_ARRVAL_P(ctor_params);
- Bucket *p;
-
- fci.param_count = 0;
- fci.params = safe_emalloc(sizeof(zval*), params_ht->nNumOfElements, 0);
- p = params_ht->pListHead;
- while (p != NULL) {
- fci.params[fci.param_count++] = (zval**)p->pData;
- p = p->pListNext;
- }
- } else {
+ if (zend_fcall_info_args(&fci, ctor_params TSRMLS_CC) == FAILURE) {
/* Two problems why we throw exceptions here: PHP is typeless
* and hence passing one argument that's not an array could be
* by mistake and the other way round is possible, too. The
@@ -1319,11 +1312,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
return;
}
- } else {
- fci.param_count = 0;
- fci.params = NULL;
}
- fci.no_separation = 1;
fcc.initialized = 1;
fcc.function_handler = ce->constructor;