You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To be exact, the if it exists part is true when accessing potentially-missing array keys. But accessing a non-existent variable won't be allowed even with this operator (side note: this is also the way this operator works in JS, where a ?? 'fallback' will still throw a ReferenceError if the variable a does not exist)
Yeah, this part should be updated. I'm not saying that the doc is correct right now. But the part saying if it exists must not be removed entirely either.
OskarStark
changed the title
[Expression-Language] Null-Coalescing operator supporting non-existent data
[ExpressionLanguage] Null-Coalescing operator supporting non-existent data
Mar 24, 2024
Potential doc issue for symfony/symfony#54359
Docs suggest that Expression Language supports null-coalescing operator for variables not passed in:
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
The text was updated successfully, but these errors were encountered: