Bug report
Using foreach to overwrite the values in an array seems to make phpstan confused about that array.
Code snippet that reproduces the problem
https://phpstan.org/r/73a29f4c-ae8e-4e22-bb61-c22a5d3e618c