mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
15 lines
353 B
PHP
15 lines
353 B
PHP
--TEST--
|
|
Unpacking arrays in constant expression
|
|
--FILE--
|
|
<?php
|
|
|
|
const A = [...[1, 2, 3]];
|
|
const B = [...['a'=>1, 'b'=>2, 'c'=>3]];
|
|
const C = [...new ArrayObject()];
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Only arrays can be unpacked in constant expression in %sgh9769.php:5
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %sgh9769.php on line 5
|