Skip to content

Commit 4a46109

Browse files
ondrejmirtesclaude
andcommitted
Add regression test for #9332
Closes phpstan/phpstan#9332 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dcf8b1a commit 4a46109

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug9332;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class HelloWorld
8+
{
9+
public function sayHello(): void
10+
{
11+
$data = ['a' => 'asdfghi'];
12+
foreach (['b', 'c'] as $x) {
13+
foreach (['d', 'e'] as $y) {
14+
$data[$x . $y] = mt_rand(1, 1000);
15+
}
16+
}
17+
18+
assertType("array{a: 'asdfghi', bd: int<1, 1000>, be: int<1, 1000>, cd: int<1, 1000>, ce: int<1, 1000>}", $data);
19+
$this->doSomething($data);
20+
}
21+
22+
/**
23+
* @param array{a: string, bd: int, be: int, cd: int, ce: int} $a
24+
*/
25+
private function doSomething(array $a): void
26+
{
27+
28+
}
29+
}

0 commit comments

Comments
 (0)