3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function generate_ints($n-1){ foreach ( range(0,$n) as $number) { yield $number; } } $gen = generate_ints(15); // iterable object can be used in foreach foreach ($gen as $g) { echo $gen->current(); }
Output for 5.3.0 - 5.4.22
Parse error: syntax error, unexpected '-', expecting ')' in /in/XtPHQ on line 3
Process exited with code 255.