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']); + } +}