xref: /PHP-7.2/Zend/tests/bug71266.phpt (revision 42184397)
1--TEST--
2Bug #71266 (Missing separation of properties HT in foreach etc)
3--FILE--
4<?php
5$one = 1;
6$two = 2;
7$arr = ['foo' => $one, 'bar' => $two];
8$obj = (object) $arr;
9foreach ($obj as $val) {
10    var_dump($val);
11    $obj->bar = 42;
12}
13
14$arr = ['foo' => $one, 'bar' => $two];
15$obj = (object) $arr;
16next($obj);
17var_dump(current($arr));
18?>
19--EXPECT--
20int(1)
21int(42)
22int(1)
23