1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-11 17:09:41 +01:00
PHP-Parser/test/code/formatPreservation/array_spread.test

29 lines
392 B
Plaintext
Raw Normal View History

2019-05-09 15:11:00 +02:00
Array spread
-----
<?php
$items = [
...$value
];
-----
$array = $stmts[0]->expr->expr;
$array->items[] = new Expr\ArrayItem(new Expr\Variable('b'));
-----
<?php
$items = [
...$value, $b
];
-----
<?php
$items =
[
... $value
];
-----
$array = $stmts[0]->expr->expr;
$array->items[] = new Expr\ArrayItem(new Expr\Variable('c'), null, false, [], true);
-----
<?php
$items =
[
... $value, ...$c
];