3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface Lol { const TEST = 'Lol'; } class Foo implements Lol { const TEST = 'Foo'; } class Bar implements Lol {} $foo = new Foo(); var_dump(get_class($foo)::TEST); $bar = new Bar(); var_dump(get_class($bar)::TEST);
based on jWLC4
Output for 7.0.0 - 7.3.0rc3
Fatal error: Cannot inherit previously-inherited or override constant TEST from interface Lol in /in/mt6mS on line 8
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_DOUBLE_COLON, expecting ')' in /in/mt6mS:16 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /in/mt6mS on line 16
Process exited with code 255.