3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); class Foo { function test() { $this->staticTest(); } function test2() { self::staticTest(); } function test3() { static::staticTest(); } 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:
34.87 ms | 402 KiB | 5 Q