3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function f1(){ self::$f2 = static::f2(); } protected static function f2() { var_dump(static::class); // returns B on the local machine and on the remote server $f3 = function () { var_dump(static::class); // returns B on the local machine and returns A on the remote server $data = static::f4(); }; } } class B extends A{} self::$B = B::instance();

preferences:
57.64 ms | 402 KiB | 5 Q