3v4l.org

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