From 21050587db155d3f69d2067cf3ea2a7145f50bca Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 16 Sep 2024 12:18:34 +0200 Subject: [PATCH] Added regression test --- tests/PHPStan/Analyser/nsrt/bug-11699.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/PHPStan/Analyser/nsrt/bug-11699.php b/tests/PHPStan/Analyser/nsrt/bug-11699.php index b79e076e41..65eebc78a6 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-11699.php +++ b/tests/PHPStan/Analyser/nsrt/bug-11699.php @@ -40,3 +40,12 @@ function doFoo3():void { assertType("'.'", $match['AB']); } } + +function doFoo4():void { + $string = 'Foo.bar'; + $match = []; + $result = preg_match('~(?[^\~,\?\.])~', $string, $match); + if ($result === 1) { + assertType("non-empty-string", $match['AB']); + } +}