Skip to content

Commit f98ae65

Browse files
committed
another less reduced test
1 parent 4c47f96 commit f98ae65

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug-12242.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,18 @@ function foo(string $str): void
1515
assertType('array{string, string}', $match);
1616
}
1717
}
18+
19+
function bar(string $str): void
20+
{
21+
$regexp = '/^
22+
(\w+) # column type [1]
23+
[\(] # (
24+
?([\d,]*) # size or size, precision [2]
25+
[\)] # )
26+
?\s* # whitespace
27+
(\w*) # extra description (UNSIGNED, CHARACTER SET, ...) [3]
28+
$/x';
29+
if (preg_match($regexp, $str, $matches)) {
30+
assertType('array{string, non-empty-string, string, string}', $matches);
31+
}
32+
}

0 commit comments

Comments
 (0)