Suggestion for Twig 4: Change the `|default()` filter to respect `false`
Author: ThomasLandauerCreated Nov 29, 2025Updated Jun 29, 2026
{{ false|default(true) }} gives true, since default() obviously treats false just like null or undefined.
It's documented at https://twig.symfony.com/doc/3.x/filters/default.html, but still weird ;-)
I just wanted to add this to the wishlist for Twig 4, but the thread at https://github.com/twigphp/Twig/issues/3951 is already closed.
Source: twigphp/Twig