Skip to content

Commit 3867153

Browse files
committed
Update MutatingScope.php
1 parent 4777927 commit 3867153

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Analyser/MutatingScope.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4308,7 +4308,14 @@ public function specifyExpressionType(Expr $expr, Type $type, Type $nativeType,
43084308
}
43094309

43104310
$scope = $this;
4311-
if ($expr instanceof Expr\ArrayDimFetch && $expr->dim !== null) {
4311+
if (
4312+
$expr instanceof Expr\ArrayDimFetch
4313+
&& $expr->dim !== null
4314+
&& !$expr->dim instanceof Expr\PreInc
4315+
&& !$expr->dim instanceof Expr\PreDec
4316+
&& !$expr->dim instanceof Expr\PostDec
4317+
&& !$expr->dim instanceof Expr\PostInc
4318+
) {
43124319
$dimType = $scope->getType($expr->dim)->toArrayKey();
43134320
if ($dimType instanceof ConstantIntegerType || $dimType instanceof ConstantStringType) {
43144321
$exprVarType = $scope->getType($expr->var);

0 commit comments

Comments
 (0)