Bug report
After the first loop, the foo offset exists in each array group element. But after the second loop, there can be group elements without foo offset.
Code snippet that reproduces the problem
https://phpstan.org/r/e89421d7-32a7-45e8-86dd-24f601acd0a8
Expected output
There should be no error.
For the dumped type the expected output is:
-Dumped type: array<int, array{bar?: non-empty-array<int<0, max>, MyClass>, foo: non-empty-array<int<0, max>, MyClass>}>
+Dumped type: array<int, array{bar?: non-empty-array<int<0, max>, MyClass>, foo?: non-empty-array<int<0, max>, MyClass>}>
Did PHPStan help you today? Did it make you happy in any way?
No response