3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A{ const TYPE = 'A'; public function getType(){ return self::TYPE; } } class B extends A{ const TYPE = 'B'; } print_r((new B)->getType());
Output for 5.6.38 - 7.3.1
A