3v4l.org

run code in 300+ PHP versions simultaneously
<?php class I extends ArrayIterator { public function current() { return parent::current(); } } $a = new ArrayObject([1, 2, 3], 0, I::class); foreach ($a as $key => &$value) { $value += 10; } unset($value); var_dump($a);

preferences:
59.29 ms | 407 KiB | 5 Q