3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public function run() { return call_user_func(array('Bar', 'getValue')); } static function getValue() { return 'Foo'; } } class Bar extends Foo { public static function getValue() { return 'Bar'; } } $x = new Bar; echo $x->run();
Output for 5.0.0 - 5.1.1, 5.1.3 - 7.1.0
Bar
Output for 5.1.2
Strict Standards: Non-static method Bar::getValue() cannot be called statically, assuming $this from compatible context Bar in /in/Q5E0b on line 6 Bar
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/Q5E0b on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/Q5E0b on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/Q5E0b on line 4
Process exited with code 255.