Smarty's foreach uses ->rewind() and then iterator_count (via the internal method _count) to decide between the foreach or foreachelse clauses when confronted with an Iterator. I don't believe it i ...
That makes sense. It might be a nice feature for an uncacheable plugin to be able to provide some compile-time info then, maybe a sixth parameter to registerPlugin could register either an array of va ...