diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-01-17 17:57:59 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-01-17 17:57:59 +0300 |
commit | a22f8ac1a96fbf3fe89b40a3f89c1f7f47a38787 (patch) | |
tree | ebdebbbde1a213d4f0e0884eb82b3a89d7d9085b /ext/pdo | |
parent | dd51cb1e346912ff93199407746608571cfdd292 (diff) | |
download | php-git-a22f8ac1a96fbf3fe89b40a3f89c1f7f47a38787.tar.gz |
More effecient array duplication
Diffstat (limited to 'ext/pdo')
-rw-r--r-- | ext/pdo/pdo_stmt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 7c2d856c29..31987ff2e5 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1304,7 +1304,7 @@ static PHP_METHOD(PDOStatement, fetchObject) if (ctor_args) { if (Z_TYPE_P(ctor_args) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(ctor_args))) { - ZVAL_DUP(&stmt->fetch.cls.ctor_args, ctor_args); + ZVAL_ARR(&stmt->fetch.cls.ctor_args, zend_array_dup(Z_ARRVAL_P(ctor_args))); } else { ZVAL_UNDEF(&stmt->fetch.cls.ctor_args); } @@ -1941,7 +1941,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array"); retval = FAILURE; } else if (Z_TYPE(args[skip+2]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL(args[skip+2]))) { - ZVAL_DUP(&stmt->fetch.cls.ctor_args, &args[skip+2]); + ZVAL_ARR(&stmt->fetch.cls.ctor_args, zend_array_dup(Z_ARRVAL(args[skip+2]))); } } |