3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function zzz (Traversable $a) { foreach ($a as $x) { echo $x."\n"; } } zzz (['a','b','c']);
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to zzz() must implement interface Traversable, array given, called in /in/rn0aF on line 10 and defined in /in/rn0aF:3 Stack trace: #0 /in/rn0aF(10): zzz(Array) #1 {main} thrown in /in/rn0aF on line 3
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Catchable fatal error: Argument 1 passed to zzz() must implement interface Traversable, array given, called in /in/rn0aF on line 10 and defined in /in/rn0aF on line 3
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/rn0aF on line 10
Process exited with code 255.