IteratorAggregate is amazing! I'm amazed that I haven't ever used it before today.
It allows a class to supply its own Iterator in the getIterator():iterable function. This means a readonly class can supply a new ArrayIterator($this->myArrayList) , which is super useful in the context of binding lists in DomTemplate.
IteratorAggregate
is amazing! I'm amazed that I haven't ever used it before today.It allows a class to supply its own Iterator in the
getIterator():iterable
function. This means areadonly
class can supply anew ArrayIterator($this->myArrayList)
, which is super useful in the context of binding lists in DomTemplate.