3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [ 1,2,3, [4,5], [6,7], ]; $f = function (array $array) use (&$f) { if (is_array($array)) { yield from f($array); } else { yield $array } }; foreach ($f($a) as $v) { echo $v; }
based on cc0LL
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '}' in /in/vnfAK on line 14
Process exited with code 255.
Output for 5.5.24 - 5.6.16
Parse error: syntax error, unexpected 'f' (T_STRING) in /in/vnfAK on line 11
Process exited with code 255.
Output for 5.4.11 - 5.4.45
Parse error: syntax error, unexpected 'from' (T_STRING) in /in/vnfAK on line 11
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/vnfAK on line 3
Process exited with code 255.