diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-16 10:39:48 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-16 10:39:48 +0200 |
commit | 32fb2d93431aa5d5b111051db998501a8d7117ee (patch) | |
tree | 3bd3d6dd31ab191603892c4e46f53b9ba0f63eca /ext/spl | |
parent | 9a85a944d8ed79a9f006873be5c5f762e037ccbf (diff) | |
parent | 9a9eed472b05292f8e8aa82129ea5d1da4b0e0c2 (diff) | |
download | php-git-32fb2d93431aa5d5b111051db998501a8d7117ee.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'ext/spl')
-rw-r--r-- | ext/spl/tests/bug77903.phpt | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/ext/spl/tests/bug77903.phpt b/ext/spl/tests/bug77903.phpt new file mode 100644 index 0000000000..842de9cca2 --- /dev/null +++ b/ext/spl/tests/bug77903.phpt @@ -0,0 +1,52 @@ +--TEST-- +Bug #77903: ArrayIterator stops iterating after offsetSet call +--FILE-- +<?php +$a = new ArrayIterator(); +$a->rewind(); +var_dump($a->valid()); // false +var_dump($a->current()); // null +$a->offsetSet(1,1); +var_dump($a->valid()); // true +var_dump($a->current()); // 1 +$a->next(); +var_dump($a->valid()); // false +var_dump($a->current()); // null +$a->offsetSet(4,4); +var_dump($a->valid()); // true +var_dump($a->current()); // 4 +$a->next(); +var_dump($a->valid()); // false +var_dump($a->current()); // null +$a->next(); +var_dump($a->valid()); // false +var_dump($a->current()); // null +$a->offsetSet(2,2); +var_dump($a->valid()); // true +var_dump($a->current()); // 2 +$a->next(); +var_dump($a->valid()); // false +var_dump($a->current()); // null +$a->next(); +var_dump($a->valid()); // false +var_dump($a->current()); // null +?> +--EXPECT-- +bool(false) +NULL +bool(true) +int(1) +bool(false) +NULL +bool(true) +int(4) +bool(false) +NULL +bool(false) +NULL +bool(true) +int(2) +bool(false) +NULL +bool(false) +NULL |