4 .. versionadded:: 1.12.2
5 The ``first`` filter was added in Twig 1.12.2.
7 The ``first`` filter returns the first "element" of a sequence, a mapping, or
12 {{ [1, 2, 3, 4]|first }}
15 {{ { a: 1, b: 2, c: 3, d: 4 }|first }}
23 It also works with objects implementing the `Traversable`_ interface.
25 .. _`Traversable`: http://php.net/manual/en/class.traversable.php