Bug report
maybe related #3512
Code snippet that reproduces the problem
https://phpstan.org/r/fb68a357-4574-4274-867b-126e8a6f3775
It looks like phpstan does no know that Map does implement IteratorAggregate, which provides this method.
Strage related behaviour is also with detecting unreachable code this works and this does not.
Expected output
Code to pass validation.