Файл: gapps/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php
Строк: 32
<?php
namespace PhpParserNodeStmt;
use PhpParserNode;
class Foreach_ extends NodeStmt
{
/** @var NodeExpr Expression to iterate */
public $expr;
/** @var null|NodeExpr Variable to assign key to */
public $keyVar;
/** @var bool Whether to assign value by reference */
public $byRef;
/** @var NodeExpr Variable to assign value to */
public $valueVar;
/** @var Node[] Statements */
public $stmts;
/**
* Constructs a foreach node.
*
* @param NodeExpr $expr Expression to iterate
* @param NodeExpr $valueVar Variable to assign value to
* @param array $subNodes Array of the following optional subnodes:
* 'keyVar' => null : Variable to assign key to
* 'byRef' => false : Whether to assign value by reference
* 'stmts' => array(): Statements
* @param array $attributes Additional attributes
*/
public function __construct(NodeExpr $expr, NodeExpr $valueVar, array $subNodes = array(), array $attributes = array()) {
parent::__construct($attributes);
$this->expr = $expr;
$this->keyVar = isset($subNodes['keyVar']) ? $subNodes['keyVar'] : null;
$this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;
$this->valueVar = $valueVar;
$this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
}
public function getSubNodeNames() {
return array('expr', 'keyVar', 'byRef', 'valueVar', 'stmts');
}
}