3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class Foo { function test() { static::test(); } function test2() { self::test(); } function test3() { static::test(); } public static function staticTest() { echo 'jow'.PHP_EOL; } } class Bar extends Foo { } $foo = new Foo(); $foo->test(); $foo->test2(); $foo->test3(); $bar = new Bar(); $bar->test(); $bar->test2(); $bar->test3();

preferences:
38.27 ms | 402 KiB | 5 Q