I can get PHP’s RecursiveDirectoryIterator working by passing it to RecursiveIteratorIterator and looping over it, like here: https://3v4l.org/ll176

But I can’t seem to figure out how to get this working with RecursiveCallbackFilterIterator. From my understanding, this should have the same output as the example above, but it’s not even looping because $contents->valid() is returning false. https://3v4l.org/MM7kZ

What am I doing wrong?

Reply to this note

Please Login to reply.

Discussion

I don’t know why, but apparently `foreach` makes a difference. Maybe something is confusing `valid()`? https://3v4l.org/vCif6