You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically $object instanceof $class where $object = Foo and $class = class-string<Foo> is doing the hierarchy in reverse.
In the example we can see an obvious failing if you call test(['DirectoryIterator'], new ArrayIterator([])). - both are Traversable but that doesn't mean the instanceof check is redundant because we're not checking Traversable directly.
The text was updated successfully, but these errors were encountered:
https://psalm.dev/r/38e9098a53
Basically
$object instanceof $class
where$object = Foo
and$class = class-string<Foo>
is doing the hierarchy in reverse.In the example we can see an obvious failing if you call
test(['DirectoryIterator'], new ArrayIterator([]))
. - both areTraversable
but that doesn't mean theinstanceof
check is redundant because we're not checkingTraversable
directly.The text was updated successfully, but these errors were encountered: