3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function f() { yield; } foreach(f() as $i) { $i++; if($i > 100) break; echo $i; echo "\n"; }
Output for 5.5.0 - 7.1.0
1
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.4.45
Notice: Use of undefined constant yield - assumed 'yield' in /in/Q2JsF on line 3 Warning: Invalid argument supplied for foreach() in /in/Q2JsF on line 5
Output for 4.3.11
Notice: Use of undefined constant yield - assumed 'yield' in /in/Q2JsF on line 3