3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { public function anExample() { } } var_dump(is_callable(['Example', 'anExample'])); function test(callable $callable) { var_dump(is_callable($callable)); } test(['Example', 'anExample']);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
bool(false) Fatal error: Uncaught TypeError: test(): Argument #1 ($callable) must be of type callable, array given, called in /in/kuJMS on line 17 and defined in /in/kuJMS:13 Stack trace: #0 /in/kuJMS(17): test(Array) #1 {main} thrown in /in/kuJMS on line 13
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
bool(true) Deprecated: Non-static method Example::anExample() should not be called statically in /in/kuJMS on line 13 bool(true)
Output for 7.3.32 - 7.3.33
bool(true) bool(true)
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
bool(true) Strict Standards: Non-static method Example::anExample() should not be called statically in /in/kuJMS on line 13 bool(true)

preferences:
240.46 ms | 402 KiB | 340 Q