Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
alexander-schranz opened this issue Mar 22, 2022 · 3 comments
Closed

Comments

@alexander-schranz
Copy link
Contributor

alexander-schranz commented Mar 22, 2022

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.

@alexander-schranz alexander-schranz changed the title Expecting null but returning array throws strange runtime error Expecting null but give an array throws strange runtime error Mar 22, 2022
@norberttech
Copy link
Member

hey @alexander-schranz thanks for reporting this bug!
#336 will fix it, expect a new patch release soon!

@norberttech
Copy link
Member

Version 6.0.8 was just released

@alexander-schranz
Copy link
Contributor Author

@norberttech Thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants