Open the-toster opened 1 year ago
I found these snippets:
That's not quite what happens: https://psalm.dev/r/009b09cc05
In fact, when you try to access the property, psalm infers mixed|string
. So it correctly gets string
from A but it takes mixed
from B.
It could be correct if B had something like a __get
method but Psalm considers object without magic method to have sealed properties (the default behaviour in recent php versions) so it should emit something like PossiblyUndefinedPropertyFetch
here.
I found these snippets:
So,
isset
checks giveRedundantCondition
https://psalm.dev/r/927830ba95