3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php abstract class Service { protected static $_var = 'S'; public static function test() { echo static::$_var . PHP_EOL; } } class ServiceA extends Service { protected static $_var = 'A'; } class ServiceAB extends Service A { protected static $_var = 'AB'; } class ServiceC extends Service { } ServiceA::test(); ServiceAB::test(); ServiceC::test();
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected 'A' (T_STRING), expecting '{' in /in/pYi73 on line 18
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting '{' in /in/pYi73 on line 18
Process exited with code 255.