From 30aeea56f94a81a3c0839b08fdc1cd01b00adaba Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Fri, 8 May 2026 12:22:46 +0200 Subject: [PATCH] Add regression test --- tests/PHPStan/Analyser/nsrt/sort.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/PHPStan/Analyser/nsrt/sort.php b/tests/PHPStan/Analyser/nsrt/sort.php index 93dfe0d1473..8d0d297dd9e 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 + } +}