1--TEST--
2Array unpacking with classes
3--FILE--
4<?php
5
6class C {
7	public const FOO = [0, ...self::ARR, 4];
8	public const ARR = [1, 2, 3];
9	public static $bar = [...self::ARR];
10}
11
12class D {
13	public const A = [...self::B];
14	public const B = [...self::A];
15}
16
17var_dump(C::FOO);
18var_dump(C::$bar);
19
20try {
21	var_dump(D::A);
22} catch (Error $ex) {
23	echo "Exception: " . $ex->getMessage() . "\n";
24}
25--EXPECT--
26array(5) {
27  [0]=>
28  int(0)
29  [1]=>
30  int(1)
31  [2]=>
32  int(2)
33  [3]=>
34  int(3)
35  [4]=>
36  int(4)
37}
38array(3) {
39  [0]=>
40  int(1)
41  [1]=>
42  int(2)
43  [2]=>
44  int(3)
45}
46Exception: Cannot declare self-referencing constant 'self::B'
47