From bbf57b114f3a00de48005c2702a40fb22cd276c7 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Mon, 30 Oct 2017 11:07:16 -0400 Subject: [PATCH] Revert array_slice passthrough optimization This reverts commit fabb5b7a7421280b43e6f11c59d9446f6b21e3e6. This reverts commit e751e6cebad959592f223f99ffd2a60cdf51bed0. --- NEWS | 2 -- ext/standard/array.c | 9 --------- 2 files changed, 11 deletions(-) diff --git a/NEWS b/NEWS index 32156cba10..6e95adb2a1 100644 --- a/NEWS +++ b/NEWS @@ -118,8 +118,6 @@ PHP NEWS - Standard: . Fixed unzserialize(), to disable creation of unsupported data structures through manually crafted strings. (Dmitry) - . Short circuit case where array_slice() would return its original array. - (Sara, Benjamin Coutu) - Zlib: . Added zlib/level context option for compress.zlib wrapper. (Sara) diff --git a/ext/standard/array.c b/ext/standard/array.c index 1c1816765b..0cd2c5c64a 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3563,15 +3563,6 @@ PHP_FUNCTION(array_slice) return; } - if ((offset == 0) && (length >= num_in)) { - zend_array *ht = Z_ARRVAL_P(input); - if (preserve_keys || (HT_IS_PACKED(ht) && HT_IS_WITHOUT_HOLES(ht))) { - /* No real slicing, and the keys will match, so just copy */ - ZVAL_COPY(return_value, input); - return; - } - } - /* Initialize returned array */ array_init_size(return_value, (uint32_t)length); -- 2.40.0