1--TEST--
2Property fetch in static property initializer
3--FILE--
4<?php
5
6enum A: int {
7    case B = 42;
8}
9
10class C {
11    public static string $d = A::B->name;
12    public static int $e = A::B->value;
13    public static string $f = A::B?->name;
14    public static int $g = A::B?->value;
15}
16
17var_dump(C::$d);
18var_dump(C::$e);
19var_dump(C::$f);
20var_dump(C::$g);
21
22?>
23--EXPECT--
24string(1) "B"
25int(42)
26string(1) "B"
27int(42)
28