1--TEST--
2Iterator::key() with by-ref return
3--FILE--
4<?php
5class Test extends ArrayIterator {
6 #[ReturnTypeWillChange]
7 function &key() {
8 return $foo;
9 }
10}
11foreach (new Test([0]) as $k => $v) {
12 var_dump($k);
13}
14?>
15--EXPECT--
16NULL
17