3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class C { const NAME = ''; const FOO = self::NAME . ' FOO'; } class D extends C { const NAME = 'D'; } class E extends C { const NAME = 'E'; } var_dump(C::FOO); var_dump(D::FOO); var_dump(E::FOO);
Output for 7.0.0 - 7.2.0
string(4) " FOO" string(4) " FOO" string(4) " FOO"
Output for 5.6.8 - 5.6.28
string(4) " FOO" string(5) "D FOO" string(5) "E FOO"
Output for 5.3.17 - 5.5.35
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /in/FNRsm on line 5
Process exited with code 255.