We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8cee183 commit b58d311Copy full SHA for b58d311
1 file changed
tests/PHPStan/Analyser/data/bug-2001.php
@@ -34,4 +34,18 @@ public function parseUrl(string $url): string
34
35
return $redirectUrl;
36
}
37
+
38
+ public function doFoo(int $i)
39
+ {
40
+ $a = ['a' => $i];
41
+ if (rand(0, 1)) {
42
+ $a['b'] = $i;
43
+ }
44
45
+ if (rand(0,1)) {
46
+ $a = ['d' => $i];
47
48
49
+ assertType('array(\'a\' => int, ?\'b\' => int)|array(\'d\' => int)', $a);
50
51
0 commit comments