3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function gen() { $gen = yield; $gen->next(); } $gen = gen(); $gen->send($gen); #$gen->next(); ?>
based on Y1FWT
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Cannot resume an already running generator in /in/fLJAe:5 Stack trace: #0 /in/fLJAe(5): Generator->next() #1 [internal function]: gen() #2 /in/fLJAe(9): Generator->send(Object(Generator)) #3 {main} thrown in /in/fLJAe on line 5
Process exited with code 255.
Output for 5.5.24 - 5.6.28
Fatal error: Cannot resume an already running generator in /in/fLJAe on line 5
Process exited with code 255.
Output for 5.0.0 - 5.4.45
Notice: Use of undefined constant yield - assumed 'yield' in /in/fLJAe on line 4 Fatal error: Call to a member function next() on a non-object in /in/fLJAe on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Use of undefined constant yield - assumed 'yield' in /in/fLJAe on line 4 Fatal error: Call to a member function on a non-object in /in/fLJAe on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant yield - assumed 'yield' in /in/fLJAe on line 4 Fatal error: Call to a member function on a non-object in /in/fLJAe on line 5