- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.23, 5.5.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.
<?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();