3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(stdClass $blah) { var_dump($blah); } foo([]); foo(null);
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be an instance of stdClass, array given, called in /in/Wdj0S on line 5 and defined in /in/Wdj0S:3 Stack trace: #0 /in/Wdj0S(5): foo(Array) #1 {main} thrown in /in/Wdj0S on line 3
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Catchable fatal error: Argument 1 passed to foo() must be an instance of stdClass, array given, called in /in/Wdj0S on line 5 and defined in /in/Wdj0S on line 3
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/Wdj0S on line 5
Process exited with code 255.