3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class test {} $a = new test(); $classParts = explode('\\', get_class($this)); echo end($classParts);
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/G1VDF:6 Stack trace: #0 {main} thrown in /in/G1VDF on line 6
Process exited with code 255.
Output for 5.3.18 - 7.0.20
Notice: Undefined variable: this in /in/G1VDF on line 6 Warning: get_class() called without object from outside a class in /in/G1VDF on line 6