3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Class1 { function foo(){ } } class Class2 { function bar(){ Class1::foo(); } } $class2 = new Class2(); $class2->bar(); echo "And the error message"; ?>
Output for 7.0.0 - 7.1.0
Deprecated: Non-static method Class1::foo() should not be called statically in /in/moFWk on line 11 And the error message
Output for 5.6.0 - 5.6.28
Deprecated: Non-static method Class1::foo() should not be called statically, assuming $this from incompatible context in /in/moFWk on line 11 And the error message
Output for 5.1.3 - 5.5.38
Strict Standards: Non-static method Class1::foo() should not be called statically, assuming $this from incompatible context in /in/moFWk on line 11 And the error message
Output for 4.3.0 - 5.1.2
And the error message