3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); class A { function B() { var_dump($this); } } //$a = new A(); A::B();
Output for 7.1.0
Deprecated: Non-static method A::B() should not be called statically in /in/7sMaB on line 12 Fatal error: Uncaught Error: Using $this when not in object context in /in/7sMaB:5 Stack trace: #0 /in/7sMaB(12): A::B() #1 {main} thrown in /in/7sMaB on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Deprecated: Non-static method A::B() should not be called statically in /in/7sMaB on line 12 Notice: Undefined variable: this in /in/7sMaB on line 5 NULL
Output for 5.0.4 - 5.6.28
Strict Standards: Non-static method A::B() should not be called statically in /in/7sMaB on line 12 Notice: Undefined variable: this in /in/7sMaB on line 5 NULL
Output for 5.0.0 - 5.0.3
Strict Standards: Non-static method A::B() should not be called statically in /in/7sMaB on line 12 Notice: Undefined variable: this in /in/7sMaB on line 5 NULL
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: this in /in/7sMaB on line 5 NULL