3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { private $baz = 1; private $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();
based on VmuHX
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Undefined class constant 'cat' in /in/sjT6H:29 Stack trace: #0 {main} thrown in /in/sjT6H on line 29
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Undefined class constant 'cat' in /in/sjT6H on line 29
Process exited with code 255.