Bug report
The examples below are derived from code where this issue surfaced for me and may be more complicated than necessary.
This works because the array shapes in question have an int at index 0: https://phpstan.org/r/b065b44f-5f92-4462-a5ca-b5d312280772
But when the value at index 0 is 0|1|2|3, int leaks into the resolved type of the adjacent value:
Code snippet that reproduces the problem
https://phpstan.org/r/edd0a6b2-b1f7-452a-88c2-8a9342e91781
Expected output
The intersection of array{0|1|2|3, int|Payload|string|null} and array{0|1|2|3, Payload} should be array{0|1|2|3, Payload}, not array{0|1|2|3, int|Payload}
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
This works because the array shapes in question have an
intat index 0: https://phpstan.org/r/b065b44f-5f92-4462-a5ca-b5d312280772But when the value at index 0 is
0|1|2|3,intleaks into the resolved type of the adjacent value:Code snippet that reproduces the problem
https://phpstan.org/r/edd0a6b2-b1f7-452a-88c2-8a9342e91781
Expected output
The intersection of
array{0|1|2|3, int|Payload|string|null}andarray{0|1|2|3, Payload}should bearray{0|1|2|3, Payload}, notarray{0|1|2|3, int|Payload}Did PHPStan help you today? Did it make you happy in any way?
No response