3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $baz = 1; public static function foo() { echo "foo\n"; } public function bar() { echo "bar\n"; $this->foo(); $this::foo(); self::foo(); self::baz(); } public function baz() { printf("baz = %d\n", $this->baz); } public static function bazr() { printf("baz = %d\n"); } } $test = new Test; $test->bar(); echo Test::bazr();

preferences:
54.35 ms | 402 KiB | 5 Q