Bug report
I have defined an array shape with an optional key. When checking the type of the value from that optional but typed key, I get the error mentioned in the title, even after I added the parameter to not treat PhpDoc as certain.
So far so good. If I reorder the checks or if I make the key no longer optional, it works as expected, even though reordering the code would not change the logic at
Code snippet that reproduces the problem
Expected output
No error reported in both cases