Skip to content

Commit 73374f5

Browse files
phpstan-botstaabm
authored andcommitted
Add regression test for #2294
Closes phpstan/phpstan#2294
1 parent db91928 commit 73374f5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug2294;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
function (): void {
8+
$entries = ['A' => null, 'B' => null];
9+
10+
$entries2 = [];
11+
foreach($entries as $key => $value) {
12+
$entries2[$key] = ['a' => 1, 'b' => 2];
13+
}
14+
assertType("array{A?: array{a: 1, b: 2}, B?: array{a: 1, b: 2}}", $entries2);
15+
};

0 commit comments

Comments
 (0)