Skip to content

Commit

Permalink
Added regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and ondrejmirtes committed Sep 16, 2024
1 parent 9437056 commit 2105058
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-11699.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@ function doFoo3():void {
assertType("'.'", $match['AB']);
}
}

function doFoo4():void {
$string = 'Foo.bar';
$match = [];
$result = preg_match('~(?<AB>[^\~,\?\.])~', $string, $match);
if ($result === 1) {
assertType("non-empty-string", $match['AB']);
}
}

0 comments on commit 2105058

Please sign in to comment.