3v4l.org

run code in 300+ PHP versions simultaneously
<?php function from1251($a) { return $a; } function foo() { yield from1251('df'); } foreach(foo() as $bar) { var_dump($bar); }
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.33, 7.4.3 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
string(2) "df"
Output for 7.0.0 - 7.0.17, 7.1.0 - 7.1.3
Parse error: syntax error, unexpected '(' in /in/gl97e on line 10
Process exited with code 255.

preferences:
129.82 ms | 402 KiB | 163 Q