Skip to content

array_splice is not seen as modifying an array's count #5017

@Seldaek

Description

@Seldaek

Bug report

When using array_splice, the count of an array is assumed to still be non-zero, although all items may have been consumed by ref.

Code snippet that reproduces the problem

https://phpstan.org/r/ed7751a9-537f-4855-a940-9f63de5d1c10

Expected output

No error, as per https://3v4l.org/YoPBg you can very well see that it is not always false :)

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

Definitely, I found some bugs in my code (and yours;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions