ArrayDimFetch.php 713 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace PhpParser\Node\Expr;
  3. use PhpParser\Node\Expr;
  4. class ArrayDimFetch extends Expr
  5. {
  6. /** @var Expr Variable */
  7. public $var;
  8. /** @var null|Expr Array index / dim */
  9. public $dim;
  10. /**
  11. * Constructs an array index fetch node.
  12. *
  13. * @param Expr $var Variable
  14. * @param null|Expr $dim Array index / dim
  15. * @param array $attributes Additional attributes
  16. */
  17. public function __construct(Expr $var, Expr $dim = null, array $attributes = array()) {
  18. parent::__construct($attributes);
  19. $this->var = $var;
  20. $this->dim = $dim;
  21. }
  22. public function getSubNodeNames() {
  23. return array('var', 'dim');
  24. }
  25. }