3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function bar(callable $fn) { echo "It passed a callable check\n"; $fn(); } class foo { function bar() { echo "oh dear lord, this is an instance function"; } } $foo = new foo; bar(['foo', 'bar']);
based on 6GgV9
Output for 7.0.0 - 7.2.0
Deprecated: Non-static method foo::bar() should not be called statically in /in/6l4LN on line 3 It passed a callable check Deprecated: Non-static method foo::bar() should not be called statically in /in/6l4LN on line 6 oh dear lord, this is an instance function
Output for 5.4.2 - 5.6.28
Strict Standards: Non-static method foo::bar() should not be called statically in /in/6l4LN on line 3 It passed a callable check Strict Standards: Non-static method foo::bar() should not be called statically in /in/6l4LN on line 6 oh dear lord, this is an instance function
Output for 5.3.17 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/6l4LN on line 19
Process exited with code 255.