Open
Description
Description
The following code:
<?php
trait MyTrait{
const A = 1;
}
interface I{
const A = 2;
}
class D implements I{
use MyTrait;
}
echo D::A;
Resulted in this output:
1
But I expected this output instead:
Fatal error: I and MyTrait define the same constant (A) in the composition of D. However, the definition differs and is considered incompatible. Class was composed in /in/EVuKh on line 10
PHP Version
8.2
Operating System
No response