Skip to content

Empty array as parameter default value doesn't work if there are optional keys #3275

@Daeroni

Description

@Daeroni

Bug report

PHPStan doesn't allow an empty array as default value for a function/method parameter, if the parameter is documented as having all its keys as optional.

Code snippet that reproduces the problem

https://phpstan.org/r/d68246c6-ee90-4cc0-9464-ce59ead0e5ab

Expected output

No errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions