Skip to content

FP: Switch(count(array)) doesn't infer non-empty-array when case is 1 or more #4499

@dktapps

Description

@dktapps

Bug report

Code snippet that reproduces the problem

https://phpstan.org/r/30604226-e6f3-459e-947c-95a807f7c064

Expected output

The dumped type should be int, not int|null, because the number of items is known to be non-zero.

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