3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen($a) { $b = yield $a; yield $a + $b + $1; } function yf() { yield from gen(1); yield from gen(4); } $g = yf(); $g->current(); $g->raise(new Exception("Whoa there lassie"));
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Parse error: syntax error, unexpected '$a' (T_VARIABLE) in /in/WLifZ on line 4
Process exited with code 255.

preferences:
168.62 ms | 1399 KiB | 22 Q