Skip to content

implode/join with null as second argument throws but is not caught by the rule #5760

@olsavmic

Description

@olsavmic

Bug report

ImplodeFunctionRule does not handle union types and therefore passing nullable array as second argument to the function does not show any error message but fails at runtime.

Using nullable array as 1st argument of implode/join function or passing other union type (then nullable array) works as expected but that's thanks to the \PHPStan\Rules\Functions\CallToFunctionParametersRule.

Code snippet that reproduces the problem

https://phpstan.org/r/65455304-be62-4b88-9ff9-6c98c4b0aff8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions