3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class TestClass { public static $_bar; } class Foo1 extends TestClass { protected static $_bar; } class Foo2 extends TestClass { public static $_bar; } //TestClass::$_bar = "tet"; Foo1::$_bar = 'Hello'; Foo2::$_bar = 'World'; echo Foo1::$_bar . ' ' . Foo2::$_bar; // Prints: World World
Output for 5.3.0 - 5.4.16
Fatal error: Access level to Foo1::$_bar must be public (as in class TestClass) in /in/eOHjJ on line 9
Process exited with code 255.