3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { function bar() { echo 'bar'; } public function baz() { echo 'baz'; } } (new Foo)->baz(); Foo::bar(); Foo::baz();
based on AjY42
Output for 7.0.0 - 7.2.0
baz Deprecated: Non-static method Foo::bar() should not be called statically in /in/bkNmd on line 17 bar Deprecated: Non-static method Foo::baz() should not be called statically in /in/bkNmd on line 18 baz
Output for 5.4.10 - 5.6.28
baz Strict Standards: Non-static method Foo::bar() should not be called statically in /in/bkNmd on line 17 bar Strict Standards: Non-static method Foo::baz() should not be called statically in /in/bkNmd on line 18 baz
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/bkNmd on line 15
Process exited with code 255.