Skip to content

Non empty array treated as empty when unpacking it as function arguments #8506

@jonsa

Description

@jonsa

Bug report

I have a variadic function where I require at least one value to be given. The arguments for said function is processed through array_filter to remove empty values. Even though I check that the arguments are not empty, PHPStan reports my function to be called with zero parameters.

Code snippet that reproduces the problem

https://phpstan.org/r/ea071efb-3ce3-46da-b611-30c91f7f07a5

Expected output

I expect PHPStan to recognize the arguments array to be non-empty and the function to be called with at least one argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions