Say welcome to the new requested feature for templating engine: “foreach_exec”.
It is combination of the “foreach” iterator tag and “execute” class method calling tag.
It works by executing given argument as execute input and then iterates over result array.
As you can understand, called method should return array.
Aim of this tag is to leverage wrapping code amount and speed optimization to avoid
extra big arrays passing into templates by $replace array members.

As usual with latest new features, it is fully covered with unit tests, ensuring it will continue to work correctly in future, after any possible code refactoring attempts or php version changes or in differetn supported environments.

P.S. I remind that minimal PHP version for YF 1.x series is PHP 5.3 (which means no support in core for PHP 5.2 and earlier versions, even for templating engine).