3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private static $x = 1; } class B extends A { function bar() { var_dump(self::$x); } }; class C extends A { function bar() { var_dump(A::$x); } }; $a = new B; $a->bar(); $b = new C; $b->bar();
based on bXFDi
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot access property B::$x in /in/4XheY:9 Stack trace: #0 /in/4XheY(21): B->bar() #1 {main} thrown in /in/4XheY on line 9
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Cannot access property B::$x in /in/4XheY on line 9
Process exited with code 255.