diff options
author | Nikita Popov <nikic@php.net> | 2014-04-09 12:31:35 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2014-04-09 12:31:35 +0200 |
commit | 21e01f2b70d133acffd82e505f70b65a996b0fd0 (patch) | |
tree | b0c599ed18b2d9205cc7d7bb8fb5e8d1579ae1e7 /ext/pgsql/pgsql.c | |
parent | 6acfaa982bfc88c478013cdca982682d8df0c7cd (diff) | |
parent | ad2ef3d97edab0d0ce034e65b7e3da1a38cc15dd (diff) | |
download | php-git-21e01f2b70d133acffd82e505f70b65a996b0fd0.tar.gz |
Merge branch 'PHP-5.6'
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r-- | ext/pgsql/pgsql.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index f5e142a775..d36901d8c1 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2793,33 +2793,22 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, 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 *ht = Z_ARRVAL_P(ctor_params); - Bucket *p; - - fci.param_count = 0; - fci.params = safe_emalloc(sizeof(zval***), ht->nNumOfElements, 0); - p = 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 + * by mistake and the other way round is possible, too. The * single value is an array. Also we'd have to make that one * argument passed by reference. */ 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; |