Bug report
If I check variable type in if statement directly type is infern correct, but when do it early and assign result to variable and check it late, then type is wrong.
Code snippet that reproduces the problem
https://phpstan.org/r/c9d5a01d-59f6-46b9-826c-6159e5a4ece3
Expected output
No error