3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test() { $n = 1; //while (true) { $x = yield; echo $x; echo $n; $n++; $x = yield; echo $x; echo $n; $n++; $x = yield; echo $x; echo $n; $n++; //} } test(); test('A'); test('B'); test('C');
based on U0QPF
Output for 5.5.24 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Output for 4.3.0 - 5.4.45
Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 7 yield1 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 12 yield2 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 17 yield3 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 7 yield1 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 12 yield2 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 17 yield3 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 7 yield1 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 12 yield2 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 17 yield3 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 7 yield1 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 12 yield2 Notice: Use of undefined constant yield - assumed 'yield' in /in/sIVSn on line 17 yield3