Skip to content

Commit c431e38

Browse files
jlherrenondrejmirtes
authored andcommitted
Add regression test for #1924
1 parent 9ea485b commit c431e38

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/PHPStan/Rules/Comparison/data/boolean-and.php

+15
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,18 @@ public function andInIfCondition($mixed, int $i): void
149149
}
150150
}
151151
}
152+
153+
function getMaybeArray() : ?array {
154+
if (rand(0, 1)) { return [1, 2, 3]; }
155+
return null;
156+
}
157+
158+
function bug1924() {
159+
$arr = [
160+
'a' => getMaybeArray(),
161+
'b' => getMaybeArray(),
162+
];
163+
164+
if (isset($arr['a']) && isset($arr['b'])) {
165+
}
166+
}

0 commit comments

Comments
 (0)