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