diff options
author | Nikita Popov <nikic@php.net> | 2014-04-07 20:46:45 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2014-04-09 12:31:21 +0200 |
commit | eaf44ec397cc3286107166ce51bac03bf6bc8f83 (patch) | |
tree | 24c6ddcb2ae1072cee6af97d7cb07e317485a82c /ext/mysqli/mysqli.c | |
parent | 6006a3ed5164b7a1e1c68482883c73b6716b10fc (diff) | |
download | php-git-eaf44ec397cc3286107166ce51bac03bf6bc8f83.tar.gz |
Remove some usages of hashtable internals
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r-- | ext/mysqli/mysqli.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 0cea68a33f..c819b976ea 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1296,19 +1296,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 @@ -1318,11 +1311,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; |