From 4ab097eba15d03f6b639155f9ac4208bbb54ea52 Mon Sep 17 00:00:00 2001 From: Eric Poe Date: Fri, 3 Feb 2017 21:56:18 -0500 Subject: [PATCH] Add test-case from bug #55157 The issue itself is not fixed, this is just a workaround. --- ext/spl/tests/bug55157_variation.phpt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ext/spl/tests/bug55157_variation.phpt diff --git a/ext/spl/tests/bug55157_variation.phpt b/ext/spl/tests/bug55157_variation.phpt new file mode 100644 index 0000000000..762caa854d --- /dev/null +++ b/ext/spl/tests/bug55157_variation.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #55157: ArrayIterator always skips the second element in the array when calling offsetUnset() +--DESCRIPTION-- +One of the test cases from bug #55157. This is a workaround around the problem that has worked +since PHP 5.0.4. +--FILE-- +rewind(); $numIt->valid();) { + echo "{$numIt->key()} => {$numIt->current()}\n"; + $numIt->offsetUnset($numIt->key()); +} +?> +--EXPECT-- +0 => 0 +1 => 1 +2 => 2 +3 => 3 -- 2.40.0