Bug report
PHPStan somehow infers int|string type when the associative array is explicitly marked with <int, int> type and reports an error in a foreach loop with $key => $value.
Error disappears after removing $array[$prev] = $v; line.
Code snippet that reproduces the problem
https://phpstan.org/r/9e3f4300-ee94-4f03-98cf-cc5cfa329f15
Expected output
Should be no error.