xref: /PHP-8.4/Zend/tests/array_unpack/gh9769.phpt (revision 93592ea7)
1--TEST--
2Unpacking arrays in constant expression
3--FILE--
4<?php
5
6const A = [...[1, 2, 3]];
7const B = [...['a'=>1, 'b'=>2, 'c'=>3]];
8const C = [...new ArrayObject()];
9
10?>
11--EXPECTF--
12Fatal error: Uncaught Error: Only arrays can be unpacked in constant expression in %sgh9769.php:5
13Stack trace:
14#0 {main}
15  thrown in %sgh9769.php on line 5
16