3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Insurance { function clsName() { echo get_class($this); } } $cl = new Insurance(); $cl->clsName(); Insurance::clsName();
based on A0pLC
Output for 7.1.0 - 7.3.0alpha1
Insurance Deprecated: Non-static method Insurance::clsName() should not be called statically in /in/s1pmV on line 2 Fatal error: Uncaught Error: Using $this when not in object context in /in/s1pmV:2 Stack trace: #0 /in/s1pmV(2): Insurance::clsName() #1 {main} thrown in /in/s1pmV on line 2
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Insurance Deprecated: Non-static method Insurance::clsName() should not be called statically in /in/s1pmV on line 2 Notice: Undefined variable: this in /in/s1pmV on line 2 Insurance
Output for 5.3.21 - 5.6.28
Insurance Strict Standards: Non-static method Insurance::clsName() should not be called statically in /in/s1pmV on line 2 Notice: Undefined variable: this in /in/s1pmV on line 2 Insurance