3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function foo() { var_dump(get_class($this)); } } class B { function bar() { A::foo(); } } B::bar();
based on MvVqa
Output for 7.1.0 - 7.2.0
Deprecated: Non-static method B::bar() should not be called statically in /in/IMSeV on line 8 Deprecated: Non-static method A::foo() should not be called statically in /in/IMSeV on line 6 Fatal error: Uncaught Error: Using $this when not in object context in /in/IMSeV:3 Stack trace: #0 /in/IMSeV(6): A::foo() #1 /in/IMSeV(8): B::bar() #2 {main} thrown in /in/IMSeV on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Deprecated: Non-static method B::bar() should not be called statically in /in/IMSeV on line 8 Deprecated: Non-static method A::foo() should not be called statically in /in/IMSeV on line 6 Notice: Undefined variable: this in /in/IMSeV on line 3 string(1) "A"
Output for 5.3.21 - 5.6.28
Strict Standards: Non-static method B::bar() should not be called statically in /in/IMSeV on line 8 Strict Standards: Non-static method A::foo() should not be called statically in /in/IMSeV on line 6 Notice: Undefined variable: this in /in/IMSeV on line 3 string(1) "A"