Skip to content

Commit 06ca776

Browse files
committed
Added regression test
1 parent 7c5200d commit 06ca776

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)