Skip to content

Array parameter with all keys as optional, but only some given, fails #3234

@Daeroni

Description

@Daeroni

Bug report

If a function/method has an array parameter with all keys documented in phpdoc as optional, and some of them, but not all are given as argument to it, phpstan incorrectly detects this as an error, either requiring an empty array, all all keys present.

Code snippet that reproduces the problem

https://phpstan.org/r/6fac5989-a4c0-4332-b39b-109f0a8da7a8

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