3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooCls {} function foo(): iterable { yield new FooCls => 1; yield new FooCls => 2; yield new FooCls => 3; yield new FooCls => 4; } $iterator = foo(); assert($iterator instanceof Iterator); var_dump($iterator->key());

preferences:
58.67 ms | 402 KiB | 5 Q