The null-coalescing operator was formally introduced in Twig 1.24 (Jan. 25, 2016).
* adding support for the
??
operator
Which means it’s now possible to do this…
{{ title ?? "Default Title" }}
You can even chain them together, to check multiple variables until a valid non-null value is found.
{{ var1 ?? var2 ?? var3 ?? var4 }}