3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Test\Bar; class Foo { } $foo = new Foo; var_dump(substr(strrchr(get_class($this), '\\'), 1));
based on T39hg
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/EQ0kk:10 Stack trace: #0 {main} thrown in /in/EQ0kk on line 10
Process exited with code 255.
Output for 5.3.22 - 7.0.20
Notice: Undefined variable: this in /in/EQ0kk on line 10 Warning: get_class() called without object from outside a class in /in/EQ0kk on line 10 bool(false)