phpcpd-next review
A focused open-source choice for PHP teams that need detailed clone reports in CI.
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
phpcpd-next is an open-source command-line tool for detecting duplicated PHP code across repositories. It is aimed at PHP developers and teams that want clone analysis as part of CI, automated reporting, PHPUnit workflows, or Laravel projects. The tool supports PHP 8.5+ and provides a headless API alongside its command-line interface, making it suitable for repository-level checks rather than editor-based inspection.
Its detection coverage is broader than exact duplication alone. Rabin-Karp handles exact clones, while TokenBag supports reordered clones. An optional suffix-tree engine detects gapped clones, and rename-insensitive fuzzy matching identifies similar code despite changed names. Orphan detection adds visibility into unreferenced symbols. Results can be emitted as console output, PMD-CPD XML, JSON, or SARIF, with GitHub Code Scanning available as an integration. Caching, incremental indexing, and CI exit codes support repeatable automated scans without changing the tool's focused scope.
The project is distributed as open-source software through Composer and source installation, with no paid tier structure described. Its platform fit centers on an API and CI workflow: PHPUnit integration and a Laravel preset are useful for teams already working in those ecosystems, while the absence of IDE integration makes it less suited to developers who want clone feedback directly in an editor. Choose phpcpd-next when a PHP repository needs configurable token-based detection, machine-readable reports, and CI controls. Look elsewhere if IDE integration or support for languages beyond PHP is a requirement.
phpcpd-next pros and cons
- Where it wins
- Detects exact, reordered, gapped, and rename-insensitive clones
- Supports caching, incremental indexing, SARIF, and CI exit codes
- Integrates with GitHub Code Scanning, PHPUnit, and Laravel
- Where it doesn't
- Requires PHP 8.5 or newer
- Does not offer IDE integration
- Focused on PHP rather than multi-language repositories
phpcpd-next fact sheet, pricing and score →
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update