3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { /** @var non-empty-string */ public const CONSTANT='foo'; } interface Bar { /** * @var non-empty-string */ public const CONSTANT='foo'; } interface Baz extends Foo, Bar {}
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Interface Baz inherits both Foo::CONSTANT and Bar::CONSTANT, which is ambiguous in /in/tjYML on line 15
Process exited with code 255.
Output for 8.1.0 - 8.1.28
Fatal error: Class Baz inherits both Foo::CONSTANT and Bar::CONSTANT, which is ambiguous in /in/tjYML on line 15
Process exited with code 255.
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30
Fatal error: Cannot inherit previously-inherited or override constant CONSTANT from interface Bar in /in/tjYML on line 15
Process exited with code 255.

preferences:
138.17 ms | 402 KiB | 121 Q