xref: /PHP-8.3/Zend/tests/traits/constant_012.phpt (revision 3b62d660)
1--TEST--
2Conflicting constants in a trait and another trait using it with different values should result in a fatal error, since this indicates that the code is incompatible.
3--FILE--
4<?php
5
6trait Trait1 {
7    public const Constant = 123;
8}
9
10trait Trait2 {
11    use Trait1;
12    public const Constant = 456;
13}
14?>
15--EXPECTF--
16Fatal error: Trait2 and Trait1 define the same constant (Constant) in the composition of Trait2. However, the definition differs and is considered incompatible. Class was composed in %s on line %d
17