3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Beer { const NAME = 'Beer!'; public static function printed(){ echo 'static Beer:NAME = '. static::NAME . PHP_EOL; } } class Ale { const NAME = 'Ale!'; public static function printed(){ forward_static_call(array('Beer','printed')); call_user_func(array('Beer','printed')); } } Ale::printed(); echo '</pre>';
Output for 5.3.7 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
static Beer:NAME = Beer! static Beer:NAME = Beer! </pre>