3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function x() { $a = new stdclass; yield $a => $a; } $b = a(); var_dump($b->current()); var_dump($b->key());
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function a() in /in/Tm4Jp:8 Stack trace: #0 {main} thrown in /in/Tm4Jp on line 8
Process exited with code 255.
Output for 5.5.24 - 5.6.28
Fatal error: Call to undefined function a() in /in/Tm4Jp on line 8
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected '$a' (T_VARIABLE) in /in/Tm4Jp on line 5
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_VARIABLE in /in/Tm4Jp on line 5
Process exited with code 255.