1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-15 19:07:06 +01:00
PHP-Parser/lib/PhpParser/Node/Expr/List_.php
Nikita Popov 574665b45b PHP 7.1: list() with keys
Expr\List will now contain ArrayItems instead of plain variables.
I'm reusing ArrayItem, because code handling list() must also handle
arrays, and this allows both to go through the same code path.

This also renames Expr\List->vars to ->items.

TODO: Should Expr\List be dropped in favor of Expr\Array with an
extra flag?
2016-07-09 21:55:55 +02:00

27 lines
598 B
PHP

<?php
namespace PhpParser\Node\Expr;
use PhpParser\Node\Expr;
class List_ extends Expr
{
/** @var ArrayItem[] List of items to assign to */
public $items;
/**
* Constructs a list() destructuring node.
*
* @param ArrayItem[] $items List of items to assign to
* @param array $attributes Additional attributes
*/
public function __construct(array $items, array $attributes = array()) {
parent::__construct($attributes);
$this->items = $items;
}
public function getSubNodeNames() {
return array('items');
}
}