3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface EventInterface { const NAME = 'event.name'; public function getName(); } class NiceEvent implements EventInterface { const NAME = 'nice.event'; public function getName() { return self::NAME; } } $o = new NiceEvent; echo $o->getName();
based on 2JsJC
Output for 7.0.0 - 7.3.0alpha1
Fatal error: Cannot inherit previously-inherited or override constant NAME from interface EventInterface in /in/BSYqf on line 10
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Cannot override previously defined constant EventInterface::NAME in NiceEvent in /in/BSYqf:10 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Cannot inherit previously-inherited or override constant NAME from interface EventInterface in /in/BSYqf on line 11
Process exited with code 255.