1 | <?php |
||
8 | class ArrayDimFetch extends AbstractExpressionCompiler |
||
9 | { |
||
10 | protected $name = 'PhpParser\Node\Expr\ArrayDimFetch'; |
||
11 | |||
12 | /** |
||
13 | * $array[1], $array[$var], $array["string"], "string"[1] |
||
14 | * |
||
15 | * @param \PhpParser\Node\Expr\ArrayDimFetch $expr |
||
16 | * @param Context $context |
||
17 | * @return CompiledExpression |
||
18 | */ |
||
19 | protected function compile($expr, Context $context) |
||
56 | } |
||
57 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: