3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo extends buz { function bar() { return $this->bar(); } function baz() { return 123; } } class buz { private static function baz() { return 234; } } $f = new foo(); echo $f->bar();
Output for 5.0.0 - 5.2.17, 7.0.0 - 7.2.6
Fatal error: Cannot make static method buz::baz() non static in class foo in /in/n61o4 on line 3
Process exited with code 255.
Output for hhvm-3.11.1 - 3.17.3
Fatal error: Uncaught Error: Cannot change static method buz::baz() to non-static in foo in /in/n61o4:3 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Fatal error: Cannot change static method buz::baz() to non-static in foo in /in/n61o4 on line 3
Process exited with code 255.
Output for 5.3.0 - 5.6.30
Fatal error: Cannot make static method buz::baz() non static in class foo in /in/n61o4 on line 4
Process exited with code 255.
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/n61o4 on line 18
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/n61o4 on line 18
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/n61o4 on line 18
Process exited with code 255.