3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar() { } } function gimme_a_callable(callable $callable) { } error_reporting(-1); var_dump(is_callable([Foo::class, 'bar'])); gimme_a_callable([Foo::class, 'bar']);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.24, 8.3.0 - 8.3.12
bool(false) Fatal error: Uncaught TypeError: gimme_a_callable(): Argument #1 ($callable) must be of type callable, array given, called in /in/akn6u on line 21 and defined in /in/akn6u:13 Stack trace: #0 /in/akn6u(21): gimme_a_callable(Array) #1 {main} thrown in /in/akn6u on line 13
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
bool(true) Deprecated: Non-static method Foo::bar() should not be called statically in /in/akn6u on line 13
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
bool(true) Strict Standards: Non-static method Foo::bar() should not be called statically in /in/akn6u on line 13

preferences:
90.13 ms | 409 KiB | 5 Q