mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Use inlined version of zval_ptr_dtor() in array_map() loop
This commit is contained in:
parent
e111bccd48
commit
5a51da9942
1 changed files with 6 additions and 7 deletions
|
@ -6024,6 +6024,7 @@ PHP_FUNCTION(array_map)
|
||||||
zend_ulong num_key;
|
zend_ulong num_key;
|
||||||
zend_string *str_key;
|
zend_string *str_key;
|
||||||
zval *zv, arg;
|
zval *zv, arg;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (Z_TYPE(arrays[0]) != IS_ARRAY) {
|
if (Z_TYPE(arrays[0]) != IS_ARRAY) {
|
||||||
php_error_docref(NULL, E_WARNING, "Argument #%d should be an array", 2);
|
php_error_docref(NULL, E_WARNING, "Argument #%d should be an array", 2);
|
||||||
|
@ -6046,13 +6047,11 @@ PHP_FUNCTION(array_map)
|
||||||
fci.no_separation = 0;
|
fci.no_separation = 0;
|
||||||
|
|
||||||
ZVAL_COPY(&arg, zv);
|
ZVAL_COPY(&arg, zv);
|
||||||
|
ret = zend_call_function(&fci, &fci_cache);
|
||||||
if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
|
i_zval_ptr_dtor(&arg ZEND_FILE_LINE_CC);
|
||||||
zval_dtor(return_value);
|
if (ret != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
|
||||||
zval_ptr_dtor(&arg);
|
zend_array_destroy(Z_ARR_P(return_value));
|
||||||
RETURN_NULL();
|
RETURN_NULL();
|
||||||
} else {
|
|
||||||
zval_ptr_dtor(&arg);
|
|
||||||
}
|
}
|
||||||
if (str_key) {
|
if (str_key) {
|
||||||
zend_hash_add_new(Z_ARRVAL_P(return_value), str_key, &result);
|
zend_hash_add_new(Z_ARRVAL_P(return_value), str_key, &result);
|
||||||
|
@ -6136,7 +6135,7 @@ PHP_FUNCTION(array_map)
|
||||||
|
|
||||||
if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
|
if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
|
||||||
efree(array_pos);
|
efree(array_pos);
|
||||||
zval_dtor(return_value);
|
zend_array_destroy(Z_ARR_P(return_value));
|
||||||
for (i = 0; i < n_arrays; i++) {
|
for (i = 0; i < n_arrays; i++) {
|
||||||
zval_ptr_dtor(¶ms[i]);
|
zval_ptr_dtor(¶ms[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue