xref: /PHP-8.4/Zend/tests/traits/constant_014.phpt (revision 3b62d660)
1--TEST--
2Cannot override a final trait constant in a class derived from the class that uses the trait
3--FILE--
4<?php
5
6trait TestTrait {
7    public final const Constant = 123;
8}
9
10class ComposingClass {
11    use TestTrait;
12    public final const Constant = 123;
13}
14
15class DerivedClass extends ComposingClass {
16    public final const Constant = 456;
17}
18
19?>
20--EXPECTF--
21Fatal error: DerivedClass::Constant cannot override final constant ComposingClass::Constant in %s on line %d
22