1--TEST--
2Test typed properties allow fetch reference for foreach
3--FILE--
4<?php
5class Foo {
6 public int $bar = 1;
7}
8
9$foo = new Foo();
10foreach ($foo as &$prop) {
11 $prop++;
12}
13var_dump($foo);
14?>
15--EXPECT--
16object(Foo)#1 (1) {
17 ["bar"]=>
18 &int(2)
19}
20