3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php iterator_apply(range(1, 5), function ($v) { echo $v.PHP_EOL; });
based on H8RR7
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to iterator_apply() must implement interface Traversable, array given in /in/m36B2:5 Stack trace: #0 /in/m36B2(5): iterator_apply(Array, Object(Closure)) #1 {main} thrown in /in/m36B2 on line 5
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Catchable fatal error: Argument 1 passed to iterator_apply() must implement interface Traversable, array given in /in/m36B2 on line 5
Process exited with code 255.