3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A extends StdClass {} function foo(callable $class) { print get_class($class); } $a = new A(); foo($a);
based on ieDvY
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be callable, object given, called in /in/eKuqX on line 8 and defined in /in/eKuqX:5 Stack trace: #0 /in/eKuqX(8): foo(Object(A)) #1 {main} thrown in /in/eKuqX on line 5
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Catchable fatal error: Argument 1 passed to foo() must be callable, object given, called in /in/eKuqX on line 8 and defined in /in/eKuqX on line 5
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Catchable fatal error: Argument 1 passed to foo() must be an instance of callable, instance of A given, called in /in/eKuqX on line 8 and defined in /in/eKuqX on line 5
Process exited with code 255.