Checks if a variable is traversable.
<pre> {# evaluates to true if the foo variable is an array or a traversable object #} {% if foo is traversable %} {# ... #} {% endif %} </pre>
mixed $value A variable:
Boolean true if the value is traversable
function twig_test_iterable($value) {
return $value instanceof Traversable || is_array($value);
}