PHP_CodeSniffer review
A focused, free PHP linter with custom rules, autofix, reporting, and CI support.
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
PHP_CodeSniffer is an open-source command-line tool for PHP developers and teams enforcing coding standards. Its phpcs script tokenizes PHP files and reports violations against selected standards, while phpcbf automatically fixes supported violations. The current 4.x series focuses on PHP file scanning and requires PHP 7.2 or later, making the product a focused fit for PHP code-quality workflows rather than a multi-language linting suite.
The free open-source model keeps the product accessible for individual developers and teams. Its built-in PSR-12 standard provides a ready starting point, while support for external standards, custom XML rulesets, and custom sniffs allows teams to encode more specific conventions. Command-line filtering by sniff, severity, and exclusions helps narrow checks for particular workflows. The main limitation is that automatic correction is limited to violations supported by phpcbf, so teams may still need manual changes for other findings.
PHP_CodeSniffer fits teams that prefer scriptable tooling and need CI execution, selectable checks, and multiple report formats, including full, summary, JSON, XML, and JUnit reports. It can be installed as PHAR files, through Composer or Phive, or from source, giving PHP projects several installation paths. There is no IDE support supplied, so teams seeking editor-integrated feedback may prefer a linter with native IDE integration. Choose PHP_CodeSniffer for standards enforcement centered on PHP, custom rules, reporting, and CI; look elsewhere if multi-language scanning or built-in IDE support is essential.
PHP_CodeSniffer pros and cons
- Where it wins
- Built-in PSR-12 and support for external coding standards
- Custom XML rulesets and custom sniffs for team conventions
- Autofix, detailed reports, filtering, and CI support
- Where it doesn't
- Focused on PHP file scanning in the current 4.x series
- No IDE support is supplied
- Autofix applies only to supported violations
PHP_CodeSniffer 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