We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6f8126 commit 4f5f8f5Copy full SHA for 4f5f8f5
tests/PHPStan/Rules/Arrays/DeadForeachRuleTest.php
@@ -45,4 +45,9 @@ public function testBug13248(): void
45
$this->analyse([__DIR__ . '/data/bug-13248.php'], []);
46
}
47
48
+ public function testBug2560(): void
49
+ {
50
+ $this->analyse([__DIR__ . '/data/bug-2560.php'], []);
51
+ }
52
+
53
tests/PHPStan/Rules/Arrays/data/bug-2560.php
@@ -0,0 +1,20 @@
1
+<?php
2
3
+namespace Bug2560;
4
5
+class HelloWorld
6
+{
7
+ public function test(): void
8
9
+ $arr = [];
10
+ foreach ([0,1] as $i) {
11
+ $arr[$i] = [];
12
+ array_push($arr[$i], "foo");
13
14
+ foreach (array_values($arr) as $vec) {
15
+ foreach ($vec as $value) {
16
+ print_r("$value");
17
18
19
20
+}
0 commit comments