Skip to content

Commit ebb1d9f

Browse files
clxmstaabondrejmirtes
authored andcommitted
added failling test
1 parent 32cfae1 commit ebb1d9f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/PHPStan/Analyser/data/bug-6439.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,16 @@ public function testLimit(string $s15, string $s16, string $s17) {
5252
// fallback to the more general form
5353
assertType("literal-string&non-empty-string", $s17);
5454
}
55+
56+
public function concatCase() {
57+
$extra = '';
58+
if (rand(0,1)) {
59+
$extra = '[0-9]';
60+
}
61+
62+
assertType("''|'[0-9]'", $extra);
63+
64+
$regex = '~[A-Z]' . $extra . '~';
65+
assertType("'~[A-Z]~'|'~[A-Z][0-9]~'", $regex);
66+
}
5567
}

0 commit comments

Comments
 (0)