Skip to content

Commit 2d79c16

Browse files
committed
array_map: Move fci configuration outside of loop
1 parent 466277c commit 2d79c16

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/standard/array.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6908,6 +6908,10 @@ PHP_FUNCTION(array_map)
69086908
} else {
69096909
zval *params = (zval *)safe_emalloc(n_arrays, sizeof(zval), 0);
69106910

6911+
fci.retval = &result;
6912+
fci.param_count = n_arrays;
6913+
fci.params = params;
6914+
69116915
/* We iterate through all the arrays at once. */
69126916
for (k = 0; k < maxlen; k++) {
69136917
for (i = 0; i < n_arrays; i++) {
@@ -6941,10 +6945,6 @@ PHP_FUNCTION(array_map)
69416945
}
69426946
}
69436947

6944-
fci.retval = &result;
6945-
fci.param_count = n_arrays;
6946-
fci.params = params;
6947-
69486948
zend_result ret = zend_call_function(&fci, &fci_cache);
69496949
ZEND_ASSERT(ret == SUCCESS);
69506950
ZEND_IGNORE_VALUE(ret);

0 commit comments

Comments
 (0)