Skip to content

Commit

Permalink
another less reduced test
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Dec 17, 2024
1 parent 24a00b6 commit 5a62f84
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-12242.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,18 @@ function foo(string $str): void
assertType('array{string, string}', $match);
}
}

function bar(string $str): void
{
$regexp = '/^
(\w+) # column type [1]
[\(] # (
?([\d,]*) # size or size, precision [2]
[\)] # )
?\s* # whitespace
(\w*) # extra description (UNSIGNED, CHARACTER SET, ...) [3]
$/x';
if (preg_match($regexp, $str, $matches)) {
assertType('array{string, non-empty-string, string, string}', $matches);
}
}

0 comments on commit 5a62f84

Please sign in to comment.