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();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
179.17 ms | 2825 KiB | 10 Q