3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); class Foo { static function test() { var_dump(static::getValue()); $x = function () { var_dump(static::getValue()); }; $x(); } static function getValue() { return 'Foo'; } } class Bar extends Foo { static function getValue() { return 'Bar'; } } Foo::test(); Bar::test();

preferences:
39.46 ms | 402 KiB | 5 Q