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 sqTRo
Output for 7.1.0 - 7.2.0
Insurance Deprecated: Non-static method Insurance::clsName() should not be called statically in /in/RjLPa on line 12 Fatal error: Uncaught Error: Using $this when not in object context in /in/RjLPa:7 Stack trace: #0 /in/RjLPa(12): Insurance::clsName() #1 {main} thrown in /in/RjLPa on line 7
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/RjLPa on line 12 Notice: Undefined variable: this in /in/RjLPa on line 7 Insurance
Output for 5.3.19 - 5.6.28
Insurance Strict Standards: Non-static method Insurance::clsName() should not be called statically in /in/RjLPa on line 12 Notice: Undefined variable: this in /in/RjLPa on line 7 Insurance