Array shape not narrowing down #8723
-
|
Wanted to raise here to double check I'm not doing something wrong or missing something, before I raise a bug ticket. Example of my issue here (https://phpstan.org/r/48e0a861-751d-4053-b8f5-34f5bcc78921, it's a minimal example so I know the shapes don't really make sense). So the array can either be 2 shapes, NumberFilterStructure or CombinedNumberFilterStructure. Since I'm doing an Is this a bug? Or is there a different way I could get PHPStan to narrow it down. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Your example definitely can't work because you're doing At least Feel free to open a bug report about the |
Beta Was this translation helpful? Give feedback.
Your example definitely can't work because you're doing
echothere, notreturn;. But to my surprise,returndoesn't work either: https://phpstan.org/r/ee716f2f-3cf4-4b58-ade2-d1375bc60e05At least
array_key_existsworks: https://phpstan.org/r/79ccf4eb-a8ac-4c80-849c-a35c57812ea4Feel free to open a bug report about the
issetexample.