We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5a4140 commit 06ae0bdCopy full SHA for 06ae0bd
tests/PHPStan/Analyser/nsrt/bug-12401.php
@@ -0,0 +1,24 @@
1
+<?php declare(strict_types = 1);
2
+
3
+namespace Bug12401;
4
5
+use function PHPStan\Testing\assertType;
6
7
+/**
8
+ * @param array{a: string, b: string}|array{c: string} $data
9
+ */
10
+function test(array $data): void {
11
+ if (isset($data['a'])) {
12
+ assertType('array{a: string, b: string}', $data);
13
+ } else {
14
+ assertType('array{c: string}', $data);
15
+ }
16
17
18
19
+ } elseif (isset($data['c'])) {
20
21
22
+ assertType('*NEVER*', $data);
23
24
+}
0 commit comments