Re: [PHP] Iterators.

2010-12-03 Thread Richard Quadling
On 3 December 2010 16:56, Nathan Nobbe wrote: > On Fri, Dec 3, 2010 at 6:09 AM, Richard Quadling > wrote: >> >> Hi. >> >> OK. I'm stuck. I just can't work this out. >> >> I like SPL. I like the re-usability. It seems right. But I just can't >> work it out. >> >> I want to read through a file syst

Re: [PHP] Iterators.

2010-12-03 Thread Nathan Nobbe
On Fri, Dec 3, 2010 at 6:09 AM, Richard Quadling wrote: > Hi. > > OK. I'm stuck. I just can't work this out. > > I like SPL. I like the re-usability. It seems right. But I just can't > work it out. > > I want to read through a file system, looking for files of a particular > type. I want to ignor

Re: [PHP] Iterators.

2010-12-03 Thread Daniel P. Brown
On Fri, Dec 3, 2010 at 08:09, Richard Quadling wrote: > > Now I know someone could supply a solution not using the SPL. I've got > one of those. But trying to use the SPL just seems to awkward. Too > many choices. Too many things with the same name I put an example up on the list this week, a

[PHP] Iterators.

2010-12-03 Thread Richard Quadling
Hi. OK. I'm stuck. I just can't work this out. I like SPL. I like the re-usability. It seems right. But I just can't work it out. I want to read through a file system, looking for files of a particular type. I want to ignore and not traverse any folder with a specific name anywhere in the direct

Re: [PHP] Iterators - seg faults again

2007-02-12 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-12 23:34:21 +0100: > Why is this happening? Can you confirm this? What has to be done different? > If you don't get these results (sef faults (I still want to get 2,3,4,5,6) > would you mind > telling me which version of php you are using? > > The file is t.php and

Re: [PHP] Iterators - seg faults again

2007-02-12 Thread Marc Weber
On Mon, 12 Feb 2007 20:33:08 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote: how should we know with out seeing the iterator_to_array() definition? iterator_to_array() function is from php. See http://de2.php.net/manual/en/function.iterator-to-array.php Here is another testcase. Why is this

Re: [PHP] Iterators

2007-02-12 Thread Jochem Maas
Marc Weber wrote: > > > function A() > { > return new RecursiveArrayIterator(array(func_get_args())); > } > $a=iterator_to_array(new RecursiveIteratorIterator( A (A(2) , A (3,4), > A(5,6; > var_dump($a); > > ?> > > I'd expect this to output an array containing 2,3,4,5,6. > But the result

[PHP] Iterators

2007-02-12 Thread Marc Weber
$a=iterator_to_array(new RecursiveIteratorIterator( A (A(2) , A (3,4), A(5,6; var_dump($a); ?> I'd expect this to output an array containing 2,3,4,5,6. But the result is: array(2) { [0]=> int(5) [1]=> int(6) } What did I miss here? Marc -- PHP General Mailing List (http://www