Skip to content

Commit 4f56f22

Browse files
committed
Update bug-14750.php
1 parent 398b361 commit 4f56f22

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@
66

77
function pregMatchDecimalIntStringTypeMatches(string $x): void
88
{
9+
if (preg_match('/[0-9]/', $x)) { // contains numbers, but might also contain others
10+
assertType('non-empty-string', $x);
11+
}
12+
913
if (preg_match('/^[0-9]+$/', $x)) {
1014
assertType('decimal-int-string', $x);
1115
}
1216
if (preg_match('/^-?[0-9]+$/', $x)) {
1317
assertType('decimal-int-string', $x);
1418
}
19+
if (preg_match('/^-?[0-9\w]+$/', $x)) {
20+
assertType('non-empty-string', $x);
21+
}
1522

1623
if (preg_match('/^(-?[0-9]+)$/', $x, $matches)) { // all chars in string are "-" or numbers
1724
assertType('decimal-int-string', $x);

0 commit comments

Comments
 (0)