Bug report
When filling array in foreach, type of final array is weird - it unions all keys together and also unions all values together so it looks like each key can have any value type, but that's not truth.
Code snippet that reproduces the problem
https://phpstan.org/r/8c25a3d5-2960-47c4-87b8-b86f5b3e4684
Expected output
Type should be something like array{a: 'asdfghi', bd: int<1, 1000>, be: int<1, 1000>, cd: int<1, 1000>, ce: int<1, 1000>} and it should be accepted by array{a: string, bd: int, be: int, cd: int, ce: int}
Bug report
When filling array in foreach, type of final array is weird - it unions all keys together and also unions all values together so it looks like each key can have any value type, but that's not truth.
Code snippet that reproduces the problem
https://phpstan.org/r/8c25a3d5-2960-47c4-87b8-b86f5b3e4684
Expected output
Type should be something like
array{a: 'asdfghi', bd: int<1, 1000>, be: int<1, 1000>, cd: int<1, 1000>, ce: int<1, 1000>}and it should be accepted byarray{a: string, bd: int, be: int, cd: int, ce: int}