mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-11 16:49:43 +01:00
29 lines
392 B
Plaintext
29 lines
392 B
Plaintext
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
|
|
]; |