1--TEST--
2Property fetch in enum initializers
3--FILE--
4<?php
5
6enum A: string {
7    case B = 'C';
8}
9
10enum D: string {
11    case E = A::B->name;
12    case F = A::B->value;
13}
14
15enum G: string {
16    case H = A::B?->name;
17    case I = A::B?->value;
18}
19
20var_dump(D::E->value);
21var_dump(D::F->value);
22var_dump(G::H->value);
23var_dump(G::I->value);
24
25?>
26--EXPECT--
27string(1) "B"
28string(1) "C"
29string(1) "B"
30string(1) "C"
31