Skip to content

Can't check if Iterator is empty #10938

@SimonFrings

Description

@SimonFrings

Bug report

Hey there, I'm working on ReactPHP and it seems we can't really check if an Iterator is empty or not. We could really use this for our Promise and Async component, happy about your insights on this.

Code snippet that reproduces the problem

https://phpstan.org/r/fac73ffc-131a-43d1-8cb7-b1a629374ac1

Expected output

I think PHPStan should detect that the Iterator is empty here.

Did PHPStan help you today? Did it make you happy in any way?

PHPStan always makes me happy

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions