3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 7.0.0 - 7.2.6
bool(true) Deprecated: Non-static method Foo::bar() should not be called statically in /in/akn6u on line 13
Output for 5.5.24 - 5.6.28
bool(true) Strict Standards: Non-static method Foo::bar() should not be called statically in /in/akn6u on line 13
Output for 5.4.13 - 5.4.45
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/akn6u on line 20
Process exited with code 255.
Output for 5.3.23 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/akn6u on line 20
Process exited with code 255.