3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function a() { yield 1; yield 2; yield 3; } $xs = a(); print $xs[1];
based on 2DAWG
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot use object of type Generator as array in /in/dRrFI:11 Stack trace: #0 {main} thrown in /in/dRrFI on line 11
Process exited with code 255.
Output for 5.5.24 - 5.6.28
Fatal error: Cannot use object of type Generator as array in /in/dRrFI on line 11
Process exited with code 255.
Output for 5.4.10 - 5.4.45
Parse error: syntax error, unexpected '1' (T_LNUMBER) in /in/dRrFI on line 5
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_LNUMBER in /in/dRrFI on line 5
Process exited with code 255.