Proposal for "Stream_Iterate"

Overview

Here's a little class to allow accessing a traversable variable (array, Iterator, etc...) as a stream using callbacks. The variable is transversed and each key/value is passed to the callback(s) to be transformed into a string to be piped into the stream. The stream is read forward-only, and has an undetermined length.

I first developed this class to use with MDB2_Iterator and HTTP_Download (note that HTTP_Download needs the patch of bug #13125 to handle undetermined content size.)

With PHP 5.3+ there will be stream context support for copy(). That will allow to very easily dump data to file (see example)