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); } } $test = new Test; //$test->bar(); Test::foo(); $test->foo();

preferences:
36.41 ms | 402 KiB | 5 Q