Returns the last element of the item.
Twig_Environment $env A Twig_Environment instance:
mixed $item A variable:
mixed The last element of the item
function twig_last(Twig_Environment $env, $item) {
$elements = twig_slice($env, $item, -1, 1, false);
return is_string($elements) ? $elements[0] : current($elements);
}