Skip to content

Commit 3ff8333

Browse files
authored
Cleanup dead code in array_slice (#10539)
We can only get to this if condition if at least preserve_keys is true. Therefore, the else branch of this check can never execute.
1 parent a26bac7 commit 3ff8333

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/standard/array.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -3616,11 +3616,7 @@ PHP_FUNCTION(array_slice)
36163616
break;
36173617
}
36183618
n++;
3619-
if (preserve_keys) {
3620-
entry = zend_hash_index_add_new(Z_ARRVAL_P(return_value), idx, zv);
3621-
} else {
3622-
entry = zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), zv);
3623-
}
3619+
entry = zend_hash_index_add_new(Z_ARRVAL_P(return_value), idx, zv);
36243620
zval_add_ref(entry);
36253621
}
36263622
}

0 commit comments

Comments
 (0)