3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class p { const FOO = 'bar'; public function __construct() { } public function hi() { echo self::FOO; } } class c extends p { const FOO = 'baz'; } $obj = new c; $obj->hi();
Output for 5.5.0 - 7.3.0rc3
bar