3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Beer { const NAME = 'Beer!'; public static function printed(){ echo 'static Beer:NAME = '. static::NAME . PHP_EOL; } } class Ale extends Beer { const NAME = 'Ale!'; public static function printed(){ forward_static_call(array('parent','printed')); call_user_func(array('parent','printed')); forward_static_call(array('Beer','printed')); call_user_func(array('Beer','printed')); } public static function yeah() { echo 'yeah!'.PHP_EOL; } } Ale::printed(); echo 'ASDASD'. PHP_EOL; $asd = new Ale(); call_user_func($asd, 'yeah');

preferences:
55.56 ms | 402 KiB | 5 Q