3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(array $classes) { array_map(function(stdClass $class) {}, $classes); } test([new stdClass, new stdClass]); test([new stdClass, 1, 2]);
based on dJjBv
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to {closure}() must be an instance of stdClass, integer given in /in/rP5ZD:5 Stack trace: #0 [internal function]: {closure}(1) #1 /in/rP5ZD(5): array_map(Object(Closure), Array) #2 /in/rP5ZD(9): test(Array) #3 {main} thrown in /in/rP5ZD on line 5
Process exited with code 255.
Output for 5.4.0 - 5.6.21
Catchable fatal error: Argument 1 passed to {closure}() must be an instance of stdClass, integer given in /in/rP5ZD on line 5
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/rP5ZD on line 8
Process exited with code 255.