3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { function test() { B::statCall(); } } class B { function statCall() { var_dump($this); } } $a = new A(); $a->test();
Output for 7.1.0
Deprecated: Non-static method B::statCall() should not be called statically in /in/DuZtS on line 7 Fatal error: Uncaught Error: Using $this when not in object context in /in/DuZtS:15 Stack trace: #0 /in/DuZtS(7): B::statCall() #1 /in/DuZtS(21): A->test() #2 {main} thrown in /in/DuZtS on line 15
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Deprecated: Non-static method B::statCall() should not be called statically in /in/DuZtS on line 7 Notice: Undefined variable: this in /in/DuZtS on line 15 NULL
Output for 5.6.0 - 5.6.28
Deprecated: Non-static method B::statCall() should not be called statically, assuming $this from incompatible context in /in/DuZtS on line 7 object(A)#1 (0) { }
Output for 5.1.3 - 5.5.38
Strict Standards: Non-static method B::statCall() should not be called statically, assuming $this from incompatible context in /in/DuZtS on line 7 object(A)#1 (0) { }
Output for 5.0.0 - 5.1.2
object(A)#1 (0) { }
Output for 4.3.0 - 4.4.9
object(a)(0) { }