3v4l.org

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