xref: /PHP-8.2/Zend/tests/traits/constant_011.phpt (revision 3b62d660)
1--TEST--
2Conflicting constants in a trait and another trait using it with different visibility modifiers 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 = 42;
8}
9
10trait Trait2 {
11    use Trait1;
12    private const Constant = 42;
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