3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface foo { const BAR = 'baz'; } class Example implements foo { const BAR = 'alcohol'; } echo Example::BAR, PHP_EOL, foo::BAR, PHP_EOL;
Output for 5.2.12 - 5.2.17, 7.0.0 - 7.3.0rc4
Fatal error: Cannot inherit previously-inherited or override constant BAR from interface foo in /in/5RMlZ on line 9
Process exited with code 255.
Output for 5.3.2 - 5.6.28
Fatal error: Cannot inherit previously-inherited or override constant BAR from interface foo in /in/5RMlZ on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.1
Fatal error: Cannot inherit previously-inherited constant BAR from interface foo in /in/5RMlZ on line 10
Process exited with code 255.
Output for 5.0.0 - 5.2.11
Fatal error: Cannot inherit previously-inherited constant BAR from interface foo in /in/5RMlZ on line 9
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/5RMlZ on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING in /in/5RMlZ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/5RMlZ on line 3
Process exited with code 255.