3v4l.org

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

preferences:
48.08 ms | 402 KiB | 5 Q