3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait C { private static $FOO = self::NAME . ' FOO'; } class D { use C; const NAME = 'D'; } class E { use C; const NAME = 'E'; } var_dump(C::$FOO); var_dump(D::$FOO); var_dump(E::$FOO);
based on Vj1GT
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot access private property C::$FOO in /in/CeS9b:17 Stack trace: #0 {main} thrown in /in/CeS9b on line 17
Process exited with code 255.
Output for hhvm-3.11.1, hhvm-3.13.2 - 3.17.3
Fatal error: Uncaught Error: Couldn't find constant C::NAME in /in/CeS9b:4 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.12.14

Process exited with code 137.
Output for hhvm-3.10.1
Fatal error: Couldn't find constant C::NAME in /in/CeS9b on line 4
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Cannot access private property C::$FOO in /in/CeS9b on line 17
Process exited with code 255.
Output for 5.4.0 - 5.5.38
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /in/CeS9b on line 4
Process exited with code 255.