We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 398b361 commit 4f56f22Copy full SHA for 4f56f22
1 file changed
tests/PHPStan/Analyser/nsrt/bug-14750.php
@@ -6,12 +6,19 @@
6
7
function pregMatchDecimalIntStringTypeMatches(string $x): void
8
{
9
+ if (preg_match('/[0-9]/', $x)) { // contains numbers, but might also contain others
10
+ assertType('non-empty-string', $x);
11
+ }
12
+
13
if (preg_match('/^[0-9]+$/', $x)) {
14
assertType('decimal-int-string', $x);
15
}
16
if (preg_match('/^-?[0-9]+$/', $x)) {
17
18
19
+ if (preg_match('/^-?[0-9\w]+$/', $x)) {
20
21
22
23
if (preg_match('/^(-?[0-9]+)$/', $x, $matches)) { // all chars in string are "-" or numbers
24
0 commit comments