psalm: Incorrectly inferred array type when merging in loop

All of these incorrectly infer $array to have exactly two values:

https://psalm.dev/r/2cdcc77b29 https://psalm.dev/r/6ce02613d5 (also incorrectly has 0 key possibly undefined) https://psalm.dev/r/6c18545837 (also incorrectly has 0 and 1 keys possibly undefined) https://psalm.dev/r/6aefa34537 (also incorrectly has 0 key possibly undefined)

About this issue

Most upvoted comments

@davidbyoung That looks like #7297.

Let’s move the discussion here: https://github.com/psalm/psalm.dev/issues/71