3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php abstract class Service { protected $_var = 'S'; public static function test() { echo static::$_var . PHP_EOL; } } class ServiceA extends Service { protected static $_var = 'A'; } class ServiceAB extends ServiceA { protected static $_var = 'AB'; } class ServiceC extends Service { } ServiceA::test(); ServiceAB::test(); ServiceC::test();
Output for 5.3.0 - 5.5.7
Fatal error: Cannot redeclare non static Service::$_var as static ServiceA::$_var in /in/3YLFc on line 16
Process exited with code 255.