3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function a() { var_dump(yield); } foreach(a() as $k => $v) { var_dump($k, $v); }
based on ZUoMM
Output for 5.5.24 - 5.6.28, 7.0.0 - 7.1.0
int(0) NULL NULL
Output for hhvm-3.10.0 - 3.12.0
Fatal error: syntax error, unexpected T_YIELD, expecting ')' in /in/mQJX3 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.4.45
Notice: Use of undefined constant yield - assumed 'yield' in /in/mQJX3 on line 5 string(5) "yield" Warning: Invalid argument supplied for foreach() in /in/mQJX3 on line 8
Output for 4.3.11
Notice: Use of undefined constant yield - assumed 'yield' in /in/mQJX3 on line 5 string(5) "yield"