10000 [ExpressionLanguage] Matches throws error for null values · Issue #45926 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[ExpressionLanguage] Matches throws error for null values #45926
Closed
@ausi

Description

@ausi

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

      0