Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[ExpressionLanguage] Matches throws error for null values #45926

Copy link
Copy link
Closed
@ausi

Description

@ausi
Issue body actions

Symfony version(s) affected

5.4.7

Description

In #45875 a behavior change was introduced.

How to reproduce

Previously the following code worked as expected:

(new ExpressionLanguage)->evaluate('foo matches "/bar/"', ['foo' => null]);

Since version 5.4.7 this now throws a TypeError: Symfony\Component\ExpressionLanguage\Node\BinaryNode::evaluateMatches(): Argument #2 ($str) must be of type string, null given

Possible Solution

If this is considered a bug or a BC break I’m happy to create a pull request to fix this (including a deprecation notice for non-string values I’d assume).

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.