3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A{ static $default="A::default "; public static $public="A::public "; protected static $protected="A::protected "; private static $private="A::private "; function static test(){ echo $this::$default; echo $this::$public; echo static::$protected; echo static::$private;//error } } class B extends A{ static $default="B::default "; public static $public="B::public "; protected static $protected="B::protected "; private static $private="B::private "; } B::test();
based on KXeNn
Output for 7.0.0 - 7.1.6
Parse error: syntax error, unexpected 'test' (T_STRING), expecting '(' in /in/MkShN on line 8
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_STRING, expecting '(' in /in/MkShN:8 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected 'static' (T_STATIC), expecting identifier (T_STRING) in /in/MkShN on line 8
Process exited with code 255.