Skip to content

Commit 1fcb7d2

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

File tree

1 file changed

+13
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)