diff --git a/hphp/runtime/base/array/array_util.cpp b/hphp/runtime/base/array/array_util.cpp index 8e827a606..a1abd81a5 100644 --- a/hphp/runtime/base/array/array_util.cpp +++ b/hphp/runtime/base/array/array_util.cpp @@ -94,7 +94,7 @@ Variant ArrayUtil::Chunk(CArrRef input, int size, return ret; } -Variant ArrayUtil::Slice(CArrRef input, int offset, int length, +Variant ArrayUtil::Slice(CArrRef input, int offset, int64_t length, bool preserve_keys) { int num_in = input.size(); if (offset > num_in) { @@ -126,7 +126,7 @@ Variant ArrayUtil::Slice(CArrRef input, int offset, int length, return out_hash; } -Variant ArrayUtil::Splice(CArrRef input, int offset, int length /* = 0 */, +Variant ArrayUtil::Splice(CArrRef input, int offset, int64_t length /* = 0 */, CVarRef replacement /* = null_variant */, Array *removed /* = NULL */) { int num_in = input.size(); diff --git a/hphp/runtime/base/array/array_util.h b/hphp/runtime/base/array/array_util.h index 5ff6620dd..f1cab6cbe 100644 --- a/hphp/runtime/base/array/array_util.h +++ b/hphp/runtime/base/array/array_util.h @@ -59,14 +59,14 @@ public: * into numerically keyed map. When "preserve_keys" is false, a map will * turn into vectors, unless keys are not numeric. */ - static Variant Slice(CArrRef input, int offset, int length, + static Variant Slice(CArrRef input, int offset, int64_t length, bool preserve_keys); /** * Removes the elements designated by offset and length and replace them * with supplied array. */ - static Variant Splice(CArrRef input, int offset, int length = 0, + static Variant Splice(CArrRef input, int offset, int64_t length = 0, CVarRef replacement = null_variant, Array *removed = nullptr); @@ -111,7 +111,7 @@ public: /** * Returns input as a numerically indexed array starting from zero - * with no gaps. Is optimized for the case where input is already + * with no gaps. Is optimized for the case where input is already * correct. Assumes input is not null. */ static Array EnsureIntKeys(CArrRef input); diff --git a/hphp/test/slow/max_int/array_slice.php b/hphp/test/slow/max_int/array_slice.php new file mode 100644 index 000000000..3aa212ee0 --- /dev/null +++ b/hphp/test/slow/max_int/array_slice.php @@ -0,0 +1,3 @@ + + int(1) + [1]=> + int(2) + [2]=> + int(3) +} diff --git a/hphp/test/slow/max_int/array_splice.php b/hphp/test/slow/max_int/array_splice.php new file mode 100644 index 000000000..129459974 --- /dev/null +++ b/hphp/test/slow/max_int/array_splice.php @@ -0,0 +1,3 @@ + + int(1) + [1]=> + int(2) + [2]=> + int(3) +} diff --git a/hphp/test/zend/bad/ext-standard-array/array_slice_variation3.php b/hphp/test/zend/good/ext-standard-array/array_slice_variation3.php similarity index 95% rename from hphp/test/zend/bad/ext-standard-array/array_slice_variation3.php rename to hphp/test/zend/good/ext-standard-array/array_slice_variation3.php index e4df3377c..64f5e6bb0 100644 --- a/hphp/test/zend/bad/ext-standard-array/array_slice_variation3.php +++ b/hphp/test/zend/good/ext-standard-array/array_slice_variation3.php @@ -1,6 +1,6 @@