3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function gen1() { $a = yield 5; return ($a + yield 2) - ($a + yield 1) * yield 3; } $g = gen1(); $g->next(); var_dump($g->current());
Output for 7.0.0 - 7.2.0
int(2)
Output for 5.4.2 - 5.6.28
Parse error: syntax error, unexpected '5' (T_LNUMBER) in /in/gaSsZ on line 4
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_LNUMBER in /in/gaSsZ on line 4
Process exited with code 255.