3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function x (ArrayAccess $y) { print_r ($y); } x(['1','fsd','sadf']);
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to x() must implement interface ArrayAccess, array given, called in /in/8LERr on line 9 and defined in /in/8LERr:3 Stack trace: #0 /in/8LERr(9): x(Array) #1 {main} thrown in /in/8LERr on line 3
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Catchable fatal error: Argument 1 passed to x() must implement interface ArrayAccess, array given, called in /in/8LERr on line 9 and defined in /in/8LERr on line 3
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/8LERr on line 9
Process exited with code 255.