3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generator($n) { foreach(generator($n) as $l) { yield $l; } } foreach(generator(10) as $l) { print $l; }
Output for 5.6.32 - 5.6.38, 7.1.0 - 7.1.1, 7.1.3 - 7.1.24, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.4 - 7.4.30, 8.0.0 - 8.0.22, 8.1.0 - 8.1.9

Process exited with code 139.
Output for 7.0.23 - 7.0.29, 7.1.2

Process exited with code 137.
Output for 7.0.22, 7.0.30 - 7.0.32
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4096 bytes) in /in/8FXB3 on line 4
Process exited with code 255.

preferences:
40.43 ms | 410 KiB | 5 Q