Skip to content

array_shift() does not reset array count bounds #2750

@dktapps

Description

@dktapps

Bug report

array_shift() modifies the number of elements in an array, but PHPStan's detection of count() bounds is unaware.

Code snippet that reproduces the problem

https://phpstan.org/r/3b0e5202-75bf-43b2-9b5c-130dcfec055f

Expected output

No error should be reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions