3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function printer() { yield; echo $string; return; } $printer = printer(); foreach($printer as $v) { var_dump($v); }
based on TJb6I
Output for 5.5.24 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
NULL Notice: Undefined variable: string in /in/IDBb0 on line 4
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.4 - 5.4.45
Notice: Use of undefined constant yield - assumed 'yield' in /in/IDBb0 on line 3 Notice: Undefined variable: string in /in/IDBb0 on line 4 Warning: Invalid argument supplied for foreach() in /in/IDBb0 on line 9
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.3
Notice: Use of undefined constant yield - assumed 'yield' in /in/IDBb0 on line 3 Notice: Undefined variable: string in /in/IDBb0 on line 4 Warning: Invalid argument supplied for foreach() in /in/IDBb0 on line 9
Output for 4.3.11
Notice: Use of undefined constant yield - assumed 'yield' in /in/IDBb0 on line 3 Notice: Undefined variable: string in /in/IDBb0 on line 4