Skip to content

Instantly share code, notes, and snippets.

/**
* Iterates over elements until pos of one elements decrease
* or end of iterator is reached. Iterating over iter changes
* that iterator on caller side.
*
* @param object i Last output of iter.next() with first element
* @param object iter Array iterator to next elements
*
* @return array Tuple of current subtree and last iter.next() object
* that break the loop.