--TEST--
"filter" filter (PHP 5.6 required)
--CONDITION--
version_compare(phpversion(), '5.6.0', '>=')
--TEMPLATE--
{% set offset = 3 %}

{% for k, v in {a: 1, b: 2, c: 5, d: 8}|filter((v, k) => (v > offset) and (k != "d")) -%}
    {{ k }} = {{ v }}
{% endfor %}

{% for k, v in it|filter((v, k) => (v > offset) and (k != "d")) -%}
    {{ k }} = {{ v }}
{% endfor %}

{# we can iterate more than once #}
{% for k, v in it|filter((v, k) => (v > offset) and (k != "d")) -%}
    {{ k }} = {{ v }}
{% endfor %}
--DATA--
return ['it' => new \ArrayIterator(['a' => 1, 'b' => 2, 'c' => 5, 'd' => 8])]
--EXPECT--
c = 5

c = 5

c = 5
