Skip to content

Expecting null but give an array throws strange runtime error #334

@alexander-schranz

Description

@alexander-schranz

I have the following snapshot:

{
    "availableLocales": null
}

Which is testing the following json:

{
    "availableLocales": [
        "en"
    ]
}

Example:
https://php-matcher.norbert.tech/?form%5Bvalue%5D=%7B%0D%0A++++%22availableLocales%22%3A+%5B%0D%0A++++++++%22en%22%0D%0A++++%5D%0D%0A%7D&form%5Bpattern%5D=%7B%0D%0A++++%22availableLocales%22%3A+null%0D%0A%7D&form%5Bmatch%5D=

It errors with Argument 4 is null instead of string at:

$this->backtrace->matcherFailed(self::class, $value, $pattern, $this->getError());

It seems like a problem with expecting null but getting an array but not sure where the error exists.

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