diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-20 10:34:17 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-20 10:34:17 +0100 |
commit | 68112224221d47169c69ea353beeb73c58ebbe3a (patch) | |
tree | 6df6967fd6e3641706b14146f741c771e258ca21 /ext/standard/array.c | |
parent | 5947437d47cc3bf8f289e52e6361fccad4b08ae3 (diff) | |
download | php-git-68112224221d47169c69ea353beeb73c58ebbe3a.tar.gz |
Eliminate uses of ZVAL_ZVAL and friends
Instead add RETURN_COPY(_VALUE) macros will the expected behavior.
RETURN_ZVAL doesn't make any sense since PHP 7, but has stuck
around, probably because the alternative was to write directly to
the return_value variable.
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r-- | ext/standard/array.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index e8f06cf99d..91e3c388d4 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3970,7 +3970,7 @@ PHP_FUNCTION(array_keys) /* Base case: empty input */ if (!elem_count) { - RETURN_ZVAL(input, 1, 0); + RETURN_COPY(input); } /* Initialize return array */ @@ -4086,7 +4086,7 @@ PHP_FUNCTION(array_values) /* Return vector-like packed arrays as-is */ if (HT_IS_PACKED(arrval) && HT_IS_WITHOUT_HOLES(arrval) && arrval->nNextFreeElement == arrlen) { - RETURN_ZVAL(input, 1, 0); + RETURN_COPY(input); } /* Initialize return array */ @@ -6064,7 +6064,7 @@ PHP_FUNCTION(array_reduce) } ZEND_HASH_FOREACH_END(); zend_release_fcall_info_cache(&fci_cache); - RETVAL_ZVAL(&result, 1, 1); + RETURN_COPY_VALUE(&result); } /* }}} */ |