3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Dad { public function early() { print __CLASS__ . PHP_EOL; } public function late() { print get_class($this) . PHP_EOL; } } class Child extends Dad {} $parent = new Dad(); $child = new Child(); print 'PARENT' . PHP_EOL; $parent->early(); $parent->late(); print 'CHILD' . PHP_EOL; $child->early(); $child->late();
based on uAsO6
Output for 5.3.20 - 7.2.0
PARENT Dad Dad CHILD Dad Child