PHPMD

What PHPMD is
PHPMD analyzes PHP source code for possible bugs, inefficient code, overly complex expressions and unused parameters, methods or properties. Its predefined rules flag code smells and possible errors, with documented rulesets covering clean code, code size, controversial practices, design, naming and unused code. Teams can add custom rules, and security rules are supported. PHPMD can be used in continuous integration and provides report renderers or options for JSON, SARIF, Checkstyle-compatible, GitHub and GitLab output, including a GitLab renderer for GitLab CI. The project identifies itself as free software under the BSD 3-Clause license. It supports Linux, macOS and Windows, as well as self-hosted use. Installation options documented by the project are a Phar file, PHIVE and Composer. Its download page lists PHP >= 5.3.9 and PHP_Depend >= 2.0.0 as requirements. Phar files are signed with a public key associated with [email protected]. The project names Manuel Pichler as its founder and says he has been involved since 2009. The homepage lists PHPMD 2.15.0, dated 2023/12/11, as its most recent release. The support page directs users to Gitter for help and the issue tracker for bugs or feature requests; commercial support and maintenance are offered through the Tidelift Subscription.
Who it suits
PHPMD suits PHP developers and teams who want automated checks for code smells, possible errors and unused code. Its custom rules and CI support may fit teams that want to incorporate those checks into their own development process.
What it does well
- Covers rulesets for clean code, design, naming and unused code.
- Supports custom rules and security rules.
- Can run in continuous integration.
- Offers JSON, SARIF, Checkstyle-compatible, GitHub and GitLab reporting options.
- Available under the BSD 3-Clause license.
What to know first
- Analyzes PHP source code only.
- Does not provide autofix.
- No IDE support is listed.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| PHPMD | PHP source code analysis · BSD 3-Clause license | Free |
As phpmd.org lists them, read 7 Oct 2026. The maker's own page has the final word.
Getting started
- Choose an installation route: Phar, PHIVE or Composer.
- Check that PHP >= 5.3.9 and PHP_Depend >= 2.0.0 meet the listed requirements.
- Use the predefined rulesets or configure custom rules.
- Select a report renderer or option, such as JSON, SARIF or GitLab.
- For help, use the Gitter channel; report bugs or feature requests through the issue tracker.
Verdict
Choose PHPMD for free PHP source analysis with predefined and custom rules, plus CI reporting options. It supports several operating systems and self-hosted use. Look elsewhere if you need automatic fixes or IDE support.
Questions
Does PHPMD cost anything?
The PHPMD plan is free, and the project uses the BSD 3-Clause license.
Which platforms does PHPMD support?
The listed platforms are Linux, macOS, Windows and self-hosted use.
How can PHPMD be installed?
The project documents installation as a Phar, through PHIVE or via Composer.
What does PHPMD analyze?
It analyzes PHP source code for possible bugs, suboptimal code, overcomplicated expressions and unused parameters, methods or properties.
Can PHPMD run in CI?
Yes. CI support is listed, and the project documents report options including GitLab and a GitLab renderer for GitLab CI.
Does PHPMD offer commercial support?
The enterprise page offers PHPMD through the Tidelift Subscription, which describes commercial support and maintenance for open-source dependencies.
Facts from PHPMD's own pages
- Analysis rules
- Its predefined rules detect code smells and possible errors in analyzed source code. · phpmd.org, 7 Oct 2026
- Company details
- The people page names Manuel Pichler as project founder and says he has been involved since 2009. · phpmd.org, 7 Oct 2026
- Enterprise support
- The enterprise page offers PHPMD through the Tidelift Subscription, which describes commercial support and maintenance for open-source dependencies. · phpmd.org, 7 Oct 2026
- Founded
- 2009 · phpmd.org, 28 Sept 2026
- GitLab CI
- Release notes state that PHPMD added a GitLab renderer for GitLab CI. · phpmd.org, 7 Oct 2026
- Installation
- The site documents installation as a Phar, through PHIVE, or via Composer. · phpmd.org, 7 Oct 2026
- Latest release shown
- The homepage lists PHPMD 2.15.0, dated 2023/12/11, as its most recent release. · phpmd.org, 7 Oct 2026
- License
- The project site identifies PHPMD as licensed under the BSD 3-Clause license. · phpmd.org, 7 Oct 2026
- PHP dependency
- The download page lists PHP >= 5.3.9 and PHP_Depend >= 2.0.0 as requirements. · phpmd.org, 7 Oct 2026
- Purpose
- PHPMD analyzes PHP source code for possible bugs, suboptimal code, overcomplicated expressions, and unused parameters, methods, or properties. · phpmd.org, 7 Oct 2026
- Reports
- Release notes document JSON, SARIF, Checkstyle-compatible, GitHub, and GitLab report renderers or options. · phpmd.org, 7 Oct 2026
- Rule categories
- The documented rulesets cover clean code, code size, controversial practices, design, naming, and unused code. · phpmd.org, 7 Oct 2026
- Signing
- PHPMD Phar files are signed with a public key associated with [email protected]. · phpmd.org, 7 Oct 2026
- Support
- The support page directs users to the Gitter channel for help and the issue tracker for bugs or feature requests. · phpmd.org, 7 Oct 2026
Where PHPMD stands on Freedom251
- Linters#16 of 33