php-file-iterator is a small library that walks directory trees and yields files matching include/exclude rules, commonly used to discover test files. It supports filtering by suffixes or prefixes (for example, “Test.php”) to keep selection deterministic. Exclusion lists help you skip vendor directories, VCS folders, or generated artifacts that would otherwise slow down tools. The iterator interface means results are streamed rather than loaded at once, which keeps memory usage modest on large codebases. It also plays nicely with glob patterns and SPL iterators, so you can combine it with other filesystem utilities. As part of the PHPUnit tooling suite, it’s optimized for speed and predictable behavior across platforms.

Features

  • Recursive file discovery with prefix and suffix filters
  • Exclude lists for vendor, VCS, cache, or build directories
  • Lazy iteration to keep memory usage low on big projects
  • Simple API that composes with SPL and glob utilities
  • Cross-platform path handling for consistent results
  • Battle-tested in PHPUnit workflows for test file discovery

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

BSD License

Follow php-file-iterator

php-file-iterator Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of php-file-iterator!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Libraries

Registered

2025-10-22