xref: /PHP-7.1/ext/spl/tests/bug69335.phpt (revision 2b6a568d)
1--TEST--
2Bug #69335 (SplArray BC break)
3--FILE--
4<?php
5$a = array(1=>1, 3=>3, 5=>5, 7=>7);
6$a = new ArrayObject($a);
7
8foreach ($a as $k => $v) {
9	var_dump("$k => $v");
10	if ($k == 3) {
11		$a['a'] = "?";
12	}
13}
14?>
15--EXPECTF--
16string(6) "1 => 1"
17string(6) "3 => 3"
18string(6) "5 => 5"
19string(6) "7 => 7"
20string(6) "a => ?"
21