diff --git a/tests/PHPStan/Analyser/nsrt/sort.php b/tests/PHPStan/Analyser/nsrt/sort.php index 93dfe0d147..8d0d297dd9 100644 --- a/tests/PHPStan/Analyser/nsrt/sort.php +++ b/tests/PHPStan/Analyser/nsrt/sort.php @@ -151,3 +151,12 @@ public function doFoo(array $array) } } + +/** @param array $arr */ +function withHasOffset(array $arr): void +{ + if (array_key_exists('foo', $arr)) { + sort($arr); + assertType('non-empty-list', $arr); // This shouldn't be NEVER + } +}