Skip to content

Commit 1c2aebd

Browse files
phpstan-botclaude
andcommitted
Add regression test for #1311
Closes phpstan/phpstan#1311 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b723d9e commit 1c2aebd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug1311;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class HelloWorld
8+
{
9+
/**
10+
* @param array<int, array{a: string}> $sets
11+
*
12+
* @return array<int, array{a: string, b: bool}>
13+
*/
14+
public function sayHello(array $sets): array
15+
{
16+
foreach ($sets as &$set) {
17+
$set['b'] = false;
18+
}
19+
20+
assertType('array<int, array{a: string, b: false}>', $sets);
21+
22+
return $sets;
23+
}
24+
}

0 commit comments

Comments
 (0)