the PHP mysqli_result class implements the Traversable interface for some time now. This gives some interesting possibilities like the following piece of code:
Note:This is an internal engine interface which cannot be implemented in PHP scripts. Either IteratorAggregate or Iterator must be used instead. When implementing an interface which extends Traversable, make sure to list IteratorAggregate or Iterator before its name in the implements clause.
i.e. you'll find the interface definition at http://docs.php.net/class.iterator and/or http://docs.php.net/class.iteratoraggregate