3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $handlersList = []; for ($i = 0; $i < 25; $i++) { $handlersList[function() use ($i) { yield "Some Shit " . $i; }]; } $i = 0; while (true) { if ($i >= count($handlersList)) break; $func = $handlersList[$i++](); echo $func->current(); }
based on rJGAQ
Output for 5.5.24 - 5.6.28, 7.0.0 - 7.1.0
Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8 Warning: Illegal offset type in /in/maMqT on line 8
Output for hhvm-3.12.0
Warning: Invalid operand type was used: Invalid type used as key in /in/maMqT on line 8 Catchable fatal error: Object of class Closure$;1366695126$871388f6c69ee1a4e1c47f0356c7bdec$ could not be converted to string in /in/maMqT on line 8
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected '"Some Shit "' (T_CONSTANT_ENCAPSED_STRING) in /in/maMqT on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/maMqT on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/maMqT on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/maMqT on line 3
Process exited with code 255.