3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function name() { return self::class; } } class B extends A {} echo (new A())->name().PHP_EOL; echo (new B())->name().PHP_EOL; class AA { public function name() { return static::class; } } class BA extends AA {} echo (new AA())->name().PHP_EOL; echo (new BA())->name().PHP_EOL;
based on UQThY
Output for 5.5.0 - 7.3.1
A A AA BA