Twig
Twig copied to clipboard
Issue with |default
{% set x = null %}
{{ dump(x|default()) }} => outputs an empty string
{{ dump(x|default(null)) }} => outputs null
{{ dimp(y|default()) }} => outputs null
|default and |default() are expected to be synonymous with |default(null), so one would not expect to specify the null but why would |default of a defined variable with a null value output an empty string ?
Twig v2.x & v3.0