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::test
Output for 5.4.0 - 5.4.28, 5.5.0 - 5.5.12
Parse error: syntax error, unexpected end of file in /in/feD86 on line 27
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/feD86 on line 27
Process exited with code 255.

preferences:
188.16 ms | 1395 KiB | 78 Q