We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c5200d commit 06ca776Copy full SHA for 06ca776
tests/PHPStan/Analyser/nsrt/bug-11854.php
@@ -0,0 +1,18 @@
1
+<?php declare(strict_types = 1);
2
+
3
+namespace Bug11854;
4
5
+use function PHPStan\Testing\assertType;
6
7
+class HelloWorld
8
+{
9
+ public function sayHello(): void
10
+ {
11
+ $arr = [];
12
+ $arr[] = rand(0,1) ? 'A' : 'B';
13
+ $arr[] = rand(0,1) ? 'C' : '';
14
15
+ assertType("array{'A'|'B', ''|'C'}", $arr);
16
+ assertType("'A '|'A C'|'B '|'B C'", implode(' ', $arr));
17
+ }
18
+}
0 commit comments