3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test (Traversable $test) { foreach($test as $t)echo $t; } test(['a']);
Output for 7.0.0 - 7.3.1
Fatal error: Uncaught TypeError: Argument 1 passed to test() must implement interface Traversable, array given, called in /in/lZT4g on line 8 and defined in /in/lZT4g:3 Stack trace: #0 /in/lZT4g(8): test(Array) #1 {main} thrown in /in/lZT4g on line 3
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught TypeError: Argument 1 passed to test() must implement interface Traversable, array given in /in/lZT4g:6 Stack trace: #0 /in/lZT4g(8): test() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to test() must implement interface Traversable, array given, called in /in/lZT4g on line 8 and defined in /in/lZT4g on line 3
Process exited with code 255.