1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

array_unshift: Use specialised iteration macro (#20410)

Forgot this while working on GH-20353, but this could avoid some
checks depending on the compiler optimizations.
This commit is contained in:
Niels Dossche
2025-11-06 23:36:43 +01:00
committed by GitHub
parent 36cbc002b5
commit 877e758a3b

View File

@@ -3763,7 +3763,7 @@ PHP_FUNCTION(array_unshift)
zend_hash_next_index_insert_new(&new_hash, &args[i]);
}
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(stack), key, value) {
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(stack), key, value) {
if (key) {
zend_hash_add_new(&new_hash, key, value);
} else {