Skip to content
DoCodeHereDeveloper tools and services

Code editors and AI coding tools · Researched comparison

Best PHP Linters and Static Analysis Tools in 2026

PHPStan is the first pick for most teams because it finds real type errors at configurable strictness levels and runs well in CI. Psalm is a strong alternative with a similar focus on type checking and taint analysis. PHP_CodeSniffer suits teams that need coding-standard enforcement rather than type analysis. All three are free and open source, so cost is rarely the deciding factor.

By · Published 22 Nov 2026

We run no ads and no affiliate links at launch. The order of a list follows our published method.

Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.

Key takeaways

ToolBest forStandout featureListed starting priceFree plan or trial
1 PHPStanTeams that want deep type checking with configurable strictnessConfigurable rule levels from 0 to maxFree (open source)Free plan
2 PsalmProjects that want type checking plus taint analysisBuilt-in taint analysis for securityFree (open source)Free plan
3 PHP_CodeSnifferEnforcing coding standards like PSR-12 across a teamShips with PSR standardsFree (open source)Free plan
4 Laravel PintLaravel projects that want zero-config code style fixesMinimal configurationFree (open source)Free plan
5 PHP-CS-FixerTeams that want fine-grained control over code style rulesVery configurable rule setsFree (open source)Free plan
6 PHP Mess DetectorFlagging complex, overly long or messy codeCatches complexity and size problemsFree (open source)Free plan
7 PHP Parallel LintFast syntax checks across many files in CIVery fast syntax checkingFree (open source)Free plan

How we picked

We picked tools that genuinely perform linting or static analysis for PHP and are actively maintained. Criteria were fit for the job (type checking, style enforcement or syntax checks), platform support, licence and price, and how well each tool fits into a CI pipeline. Sources are vendor pages, official documentation and project repositories. Prices and features change, so confirm details on the vendor site before you commit.

01

PHPStan

Best for: Teams that want deep type checking with configurable strictness

PHPStan analyzes PHP code without running it and reports type errors, undefined methods and dead code. You raise strictness with a level setting in a config file, so a legacy codebase can start low and tighten over time. It installs through Composer and runs on any OS with PHP.

The tool supports baseline files that ignore existing errors so new code stays clean. Extensions add framework-aware rules for tools like Laravel and Symfony. It is free and open source under the MIT license.

Skip PHPStan if you only need formatting and style checks; a coding-standard tool is lighter for that job.

Pros

  • Configurable rule levels from 0 to max
  • large extension ecosystem

Cons

  • Higher levels need more setup
  • some dynamic code needs stubs

Price: Free (open source), as listed by the vendor (PHPStan website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: higher levels need more setup.

Verdict. A sensible pick for teams that want deep type checking with configurable strictness.

02

Psalm

Best for: Projects that want type checking plus taint analysis

Psalm is a static analysis tool from Vimeo that checks types, finds unused code and runs taint analysis to trace untrusted input. It installs via Composer and runs on any platform with PHP. Issue levels let you tune how strict the report is.

It supports baseline files to suppress existing issues and integrates with common editors and CI systems. Psalm is free and open source under the MIT license. It suits teams that want security-oriented checks alongside type analysis.

Skip Psalm if you need only style enforcement or want the simplest possible setup.

Pros

  • Built-in taint analysis for security
  • detailed issue levels

Cons

  • Can be slower on large codebases
  • config has a learning curve

Price: Free (open source), as listed by the vendor (Psalm website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: can be slower on large codebases.

Verdict. A sensible pick for projects that want type checking plus taint analysis.

03

PHP_CodeSniffer

Best for: Enforcing coding standards like PSR-12 across a team

PHP_CodeSniffer tokenizes PHP files and checks them against a coding standard such as PSR-12. It includes two tools: phpcs reports violations and phpcbf fixes many of them automatically. It installs through Composer and runs anywhere PHP runs.

Custom standards let a team encode its own rules. It is free and open source under a BSD license. It does not analyze types, so pair it with PHPStan or Psalm for bug detection.

Skip it if you want one tool for both style and type checks, or if you prefer an opinionated formatter over a rule engine.

Pros

  • Ships with PSR standards
  • can auto-fix many violations

Cons

  • Not a type checker
  • custom rules take effort

Price: Free (open source), as listed by the vendor (PHP_CodeSniffer website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: not a type checker.

Verdict. A sensible pick for enforcing coding standards like PSR-12 across a team.

04

Laravel Pint

Best for: Laravel projects that want zero-config code style fixes

Laravel Pint is a code style fixer built on PHP-CS-Fixer with presets tuned for Laravel. It installs through Composer and runs on any platform with PHP. A single command formats a project, and presets like laravel and psr12 set the rules.

It is free and open source under the MIT license. It fixes style rather than reporting type problems, so it complements a static analyzer. Teams outside Laravel can still use it with a PSR preset, though the defaults lean toward Laravel conventions.

Skip Pint if you need configurable rule reporting or work outside the PHP ecosystem it targets.

Pros

  • Minimal configuration
  • built on PHP-CS-Fixer

Cons

  • Focused on formatting, not type errors
  • Laravel-oriented defaults

Price: Free (open source), as listed by the vendor (Laravel Pint website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: focused on formatting, not type errors.

Verdict. A sensible pick for laravel projects that want zero-config code style fixes.

05

PHP-CS-Fixer

Best for: Teams that want fine-grained control over code style rules

PHP-CS-Fixer automatically fixes PHP coding standard issues. It installs through Composer and runs on any OS with PHP. Rule sets cover PSR standards and many optional rules, and a config file defines exactly what gets changed.

A dry-run mode reports violations without editing files, which suits CI pipelines. It is free and open source under the MIT license. It handles style only, so pair it with a type checker.

Skip it if you want a preset-only formatter with almost no configuration.

Pros

  • Very configurable rule sets
  • dry-run mode for CI checks

Cons

  • Configuration can get complex
  • style only, no type checks

Price: Free (open source), as listed by the vendor (PHP-CS-Fixer website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: configuration can get complex.

Verdict. A sensible pick for teams that want fine-grained control over code style rules.

06

PHP Mess Detector

Best for: Flagging complex, overly long or messy code

PHP Mess Detector looks for code smells such as excessive complexity, long methods, unused parameters and duplicated code. It installs through Composer and runs on any platform with PHP. Rule sets can be tuned or extended with custom rules.

It is free and open source. Reports can be noisy on large legacy codebases, so start with a focused rule set and a baseline. It complements type checkers and style tools rather than replacing them.

Skip it if you only want type errors or formatting fixes.

Pros

  • Catches complexity and size problems
  • rule sets are configurable

Cons

  • Can produce noisy reports
  • not a type checker

Price: Free (open source), as listed by the vendor (PHP Mess Detector website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: can produce noisy reports.

Verdict. A sensible pick for flagging complex, overly long or messy code.

07

PHP Parallel Lint

Best for: Fast syntax checks across many files in CI

PHP Parallel Lint checks PHP files for syntax errors in parallel, which makes it fast on large projects. It installs through Composer and runs on any platform with PHP. It is often used as a quick first gate before slower analyzers run.

It is free and open source. It does not check types, style or complexity, so treat it as a fast pre-check rather than a full linter. It suits CI pipelines that want to fail early on broken files.

Skip it if you need any analysis beyond syntax.

Pros

  • Very fast syntax checking
  • simple to add to CI

Cons

  • Syntax only, no deeper analysis
  • limited reporting

Price: Free (open source), as listed by the vendor (PHP Parallel Lint website). Confirm the current plan price before you buy.

Skip it if this limit matters to you: syntax only, no deeper analysis.

Verdict. A sensible pick for fast syntax checks across many files in CI.

Who should use what

If you maintain a large codebase and want to catch type bugs, start with PHPStan and raise its level over time. If security matters, add Psalm's taint analysis. If your main problem is inconsistent formatting, use PHP_CodeSniffer or PHP-CS-Fixer, or Laravel Pint for a Laravel project. For a fast syntax gate in CI, add PHP Parallel Lint. Most teams run one type checker plus one style tool.

What to check before you buy

FAQ

Do I need more than one PHP linter?

Usually yes. Type checkers like PHPStan and Psalm find logic and type errors, while tools like PHP_CodeSniffer and PHP-CS-Fixer enforce style. Running one of each covers more ground than a single tool.

Are these PHP linters free?

PHPStan, Psalm, PHP_CodeSniffer, Laravel Pint, PHP-CS-Fixer, PHP Mess Detector and PHP Parallel Lint are all free and open source. You pay only in setup time and CI compute.

Can PHP linters run in CI pipelines?

Yes. All the tools listed install through Composer and provide exit codes or report formats that CI systems can use to fail a build. Many support baseline files so existing issues do not block new work.

Do these tools send my code to a server?

No. These are command-line tools that run locally or on your own CI runners. Your source code stays on your machine or infrastructure.

Which PHP linter is easiest to start with?

Laravel Pint needs almost no configuration for Laravel projects, and PHP Parallel Lint is simple to add for syntax checks. PHPStan is straightforward at low levels but needs more setup as strictness rises.

Sources we checked

  1. PHPStan (official site)
  2. Psalm (official site)
  3. PHP Parallel Lint (official site)
  4. PHP Parallel Lint (official site)
  5. PHP-CS-Fixer (official site)
  6. PHP Mess Detector (official site)
  7. PHP Parallel Lint (official site)

Change log. First published 22 Nov 2026.