3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $foo = 'foo'; } class Set extends ArrayIterator { public $bar = 'bar'; } $array = [ new Foo(), ]; $set = new Set($array); var_dump(current($set));

preferences:
29.07 ms | 405 KiB | 5 Q