This one time, at band camp, "John Holmes" <[EMAIL PROTECTED]> wrote:

> Is anyone using SPL iterators out there? Any examples you'd like to share 
> that you find useful? Iterating through databases or large files, etc? Just 
> curious what people are using this for before I write some stuff myself. :)

I am using them in the current script I am writing (thumbnail generator).
Basically just getting a directory listing and iterating through the array
of filenames and if its an image file, generate a thumbnail. This is my
first foray into them.

I have found a bug in the array iterator through using count(). This
causes a segfault. Have been poking through the source to find the 
problem, but no joy yet.

This sort of thing causes a segfault. Assume ArrayReloded implements iterator
as in the tutorial you pointed to.
// Create iterator object
$critters = new ArrayReloaded(array ('dingo','wombat','koala',));

// echo the size of the array
echo $critters->count();

Kind regards
Kevin

---------
"Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to