finds.dev← search

// the find

sebastianbergmann/php-file-iterator

★ 7,492 · PHP · BSD-3-Clause · updated Jul 2026

FilterIterator implementation that filters files based on a list of suffixes, prefixes, and other exclusion criteria.

A FilterIterator for PHP that walks directory trees and returns only files matching specified suffixes, prefixes, or path patterns. It ships as a PHPUnit dependency — that's where its 7k stars come from, not organic adoption. You've almost certainly already been using it without knowing it.

Actively maintained by Sebastian Bergmann, updated as recently as two days ago. The tooling setup is unusually thorough for a small utility: PHPStan at strict level, type-coverage enforcement via tomasvotruba/type-coverage, and a proper CI pipeline. The Facade class gives you a single static entry point that handles the common cases without having to wire up the Iterator and Factory yourself.

The README is essentially empty — installation instructions and nothing else. If you haven't already read the PHPUnit internals, you'll need to dig into the source to understand what filter combinations are actually supported. No documentation on how prefix/suffix/exclude criteria interact when combined, which matters if you're trying to use this outside the PHPUnit context. The star count is entirely borrowed prestige; actual standalone users are probably in the dozens.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →