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 l5cmi
Output for 7.2.0 - 7.3.1
Warning: Use of undefined constant this - assumed 'this' (this will throw an Error in a future version of PHP) in /in/Oj16u on line 7 Warning: get_class() expects parameter 1 to be object, string given in /in/Oj16u on line 7 Deprecated: Non-static method Insurance::clsName() should not be called statically in /in/Oj16u on line 12 Warning: Use of undefined constant this - assumed 'this' (this will throw an Error in a future version of PHP) in /in/Oj16u on line 7 Warning: get_class() expects parameter 1 to be object, string given in /in/Oj16u on line 7
Output for 7.1.25
Notice: Use of undefined constant this - assumed 'this' in /in/Oj16u on line 7 Warning: get_class() expects parameter 1 to be object, string given in /in/Oj16u on line 7 Deprecated: Non-static method Insurance::clsName() should not be called statically in /in/Oj16u on line 12 Notice: Use of undefined constant this - assumed 'this' in /in/Oj16u on line 7 Warning: get_class() expects parameter 1 to be object, string given in /in/Oj16u on line 7