xref: /PHP-8.1/Zend/tests/bug71266.phpt (revision dcc8463a)
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--EXPECTF--
20int(1)
21int(42)
22
23Deprecated: next(): Calling next() on an object is deprecated in %s on line %d
24int(1)
25