Closed
Description
Description
The following code:
<?php
class A {
final public const VALUE = 'something';
}
enum B: string {
case C = A::VALUE;
}
var_dump(B::C);
Resulted in this output:
PHP Fatal error: Enum case value must be compile-time evaluatable in /.../enum_const_string.php on line 7
But I expected this output instead:
enum(B::C)
PHP Version
PHP 8.1.4
Operating System
No response