3v4l.org

run code in 300+ PHP versions simultaneously
<?php function uppercase(Traversable $in) { foreach ($in as $word) { yield strtoupper($word); } } function reverse(Traversable $in) { foreach ($in as $word) { yield strrev($word); } } function each_println(Traversable $in) { foreach ($in as $line) { echo "$line\n"; } } $words = new ArrayIterator(["foo", "bar", "baz"]); each_println(reverse(uppercase($words)));

preferences:
36.14 ms | 402 KiB | 5 Q