3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new ArrayObject(); $a['b'] = 10; $a[1] = 22; foreach ($a as $b) { print_r($b . PHP_EOL); } iterator_apply($a, fn ($x) => print_r($x . PHP_EOL));

preferences:
80.93 ms | 405 KiB | 5 Q