diff --git a/src/Type/Regex/RegexGroupParser.php b/src/Type/Regex/RegexGroupParser.php index 5d8e2d7bfd..5bf632b825 100644 --- a/src/Type/Regex/RegexGroupParser.php +++ b/src/Type/Regex/RegexGroupParser.php @@ -617,7 +617,7 @@ private function walkGroupAst( ->onlyLiterals($newLiterals) ->nonEmpty($walkResult->isNonEmpty()->or($nonEmpty)) ->nonFalsy($walkResult->isNonFalsy()->or($nonFalsy)) - ->decimalInteger($walkResult->isDecimalInteger()->and($decimalInteger)); + ->decimalInteger(TrinaryLogic::maxMin($walkResult->isDecimalInteger(), $decimalInteger)); } // [^0-9] should not parse as decimal-int-string, and [^list-everything-but-numbers] is technically diff --git a/tests/PHPStan/Analyser/nsrt/bug-14784.php b/tests/PHPStan/Analyser/nsrt/bug-14784.php new file mode 100644 index 0000000000..581bc14195 --- /dev/null +++ b/tests/PHPStan/Analyser/nsrt/bug-14784.php @@ -0,0 +1,46 @@ +