Tag Archives: Iterator

Assorted SPL Iterator Examples

This is an assorted list for three SPL iterator resources out there in the net. I’m sure there is more, so feel free to leave a comment I’m happy to add them. spl-examples (salathe) The idea is to have you … Continue reading

Posted in Hakre's Tips | Tagged , , , , , , | 4 Comments

Getting N Random Elements out of an Iterator – RandomIterator

Considering there is an Iterator or Traversable with an unknown number of elements, I wondered if it is possible to get one or more random iterations out of it.

Posted in Developing, Hakre's Tips, PHP Development, Pressed | Tagged , , , , , , | Leave a comment

Iterating over Multiple Iterators at Once

PHP’s SPL has two build-in Iterators that deal with multiple iterators at once: AppendIterator and MultipleIterator. In this posting I’ll cover both a bit: AppendIterator will put one iterator after the other so it get’s like a long queue or … Continue reading

Posted in Developing, Hakre's Tips, PHP Development, Pressed | Tagged , , , , , , , | 1 Comment

Some PHP Iterator Fun

I must have had too much free time. Over at Stackoverflow some kind of PHP question pops up from time to time about how to distribute a sequence of data in form of a table or in columns. You already … Continue reading

Posted in Developing, Hakre's Tips, PHP Development, Pressed | Tagged , , , , , , , | 1 Comment