3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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::$cats; $test = new Test; $test->bar();
based on R9H4j
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Access to undeclared static property: Test::$cats in /in/0EMJA:29 Stack trace: #0 {main} thrown in /in/0EMJA on line 29
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Access to undeclared static property: Test::$cats in /in/0EMJA on line 29
Process exited with code 255.