Skip to content

Commit c72e6ac

Browse files
committed
expect invalidation
1 parent d8ea5df commit c72e6ac

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,14 @@ public function testBug13538(): void
10341034
"Offset int might not exist on non-empty-array<int, ''>.",
10351035
49,
10361036
],
1037+
[
1038+
"Offset string might not exist on non-empty-array<string, ''>.",
1039+
68,
1040+
],
1041+
[
1042+
"Offset int might not exist on non-empty-array<int, non-empty-array<string, ''>>.",
1043+
68,
1044+
],
10371045
]);
10381046
}
10391047

tests/PHPStan/Rules/Arrays/data/bug-13538.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,9 @@ function doBar(array $arr, int $i, string $s): void
6262
assertType("non-empty-array<string, ''>", $logs[$i]);
6363
assertType("''", $logs[$i][$s]);
6464
echo $logs[$i][$s];
65+
66+
$i++;
67+
68+
echo $logs[$i][$s];
6569
}
6670
}

0 commit comments

Comments
 (0)