Skip to content

[ExpressionLanguage] Null-Coalescing operator supporting non-existent data #19695

Closed
@adamkiss

Description

@adamkiss

Potential doc issue for symfony/symfony#54359

Docs suggest that Expression Language supports null-coalescing operator for variables not passed in:

$data = ['exists' => 1];
$language->evaluate('doesnt_exist ?? 2', $data);

But it was suggested to me in the linked issue that the code doesn't seem to actually support that, and that null coalescing operator also isn't mentioned in https://symfony.com/doc/current/reference/formats/expression_language.html#supported-operators

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExpressionLanguagehasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions