Tool category

PHP bug finders

Tools that inspect PHP code without running it to identify type errors, defects, dependency problems, and potential vulnerabilities.

Tools in this category

27 tools. Editor picks appear first; review the requirements and trade-offs of each tool.

Bug finders

PHPStan

Active

PHP Static Analysis Tool - discover bugs in your code without running it!

  • PHP
  • PHPStan
  • Static Analysis
Type
Analyzer
PHP
^7.4|^8.0
License
MIT
Install
composer require --dev phpstan/phpstan
Stars
14,160
Latest
2.3.6
Last commit
Last release
Quick pros & cons for PHPStan

ProPairs mature type analysis with a large extension ecosystem.

ConHigher rule levels often need annotations and gradual adoption.

Editorially reviewed

Bug finders

psalm

Active

A PHP static analysis tool for finding errors and security vulnerabilities in PHP applications

  • PHP
  • Static Analysis
Type
Analyzer
PHP
~8.1.31 || ~8.2.27 || ~8.3.16 || ~8.4.3 || ~8.5.0
License
MIT
Install
composer require --dev vimeo/psalm
Stars
5,931
Latest
7.7.0
Last commit
Last release
Quick pros & cons for psalm

ProCombines expressive types with taint and security analysis.

ConAdvanced checks add annotation and configuration work.

Editorially reviewed

Bug finders

jscpd

Active

Copy/paste detector for programming source code, supports 223 formats. AI-ready with token-efficient reporter, skill and MCP server.

  • Code Quality
  • Static Analysis
Type
Analyzer
License
MIT
Stars
6,560
Latest
v5.4.3
Last commit
Last release
Quick pros & cons for jscpd

ProDetects duplication across PHP and hundreds of other formats.

ConGenerated code and boilerplate need threshold tuning.

Editorially reviewed

Bug finders

Phan

Active

Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.

  • PHP
  • Static Analysis
Type
Analyzer
PHP
^8.1.0
Install
composer require --dev phan/phan
Stars
5,621
Latest
6.0.11
Last commit
Last release
Quick pros & cons for Phan

ProPrioritizes low false-positive AST-based type analysis.

ConIt requires the php-ast extension and careful configuration.

Editorially reviewed

Bug finders

mago

Active

Mago is a toolchain for PHP that aims to provide a set of tools to help developers write better code.

  • PHP
  • Static Analysis
Type
Analyzer
PHP
~8.1 || ~8.2 || ~8.3 || ~8.4 || ~8.5 || ~8.6
License
Apache-2.0
Install
composer require --dev carthage-software/mago
Stars
3,560
Latest
1.60.2
Last commit
Last release
Quick pros & cons for mago

ProCombines fast linting, analysis, and formatting in one toolchain.

ConIts ecosystem is younger than established PHP analyzers.

Editorially reviewed

Bug finders

PHP Mess Detector

Active

PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.

  • PHP
  • Static Analysis
Type
Analyzer
PHP
>=5.3.9
License
BSD-3-Clause
Install
composer require --dev phpmd/phpmd
Stars
2,465
Latest
3.0.0
Last commit
Last release
Quick pros & cons for PHP Mess Detector

ProCatches complexity, naming, and maintainability problems.

ConDefault rules can be noisy on existing codebases.

Editorially reviewed

Bug finders

PHP Compatibility

Active

PHP Compatibility check for PHP_CodeSniffer

  • PHP
Type
Ruleset
PHP
>=5.3
License
LGPL-3.0
Install
composer require --dev phpcompatibility/php-compatibility
Stars
2,315
Latest
9.3.5
Last commit
Last release
Quick pros & cons for PHP Compatibility

ProChecks code against a target PHP version range.

ConIt needs PHP_CodeSniffer and cannot prove runtime compatibility.

Editorially reviewed

Bug finders

Composer-Unused

Active

Show unused composer dependencies by scanning your code

  • PHP
Type
Analyzer
PHP
^8.1
License
MIT
Install
composer require --dev icanhazstring/composer-unused
Stars
1,694
Latest
0.9.8
Last commit
Last release
Quick pros & cons for Composer-Unused

ProQuickly flags Composer packages that code may not use.

ConDynamic package use may require exclusions.

Editorially reviewed

Active

Deep PHP code inspections directly in JetBrains IDEs

  • PHP
  • Static Analysis
Type
Extension
Delivery
PhpStorm and IntelliJ IDEA Ultimate plugin
Stars
1,485
Latest
-
Last commit
Last release
Unknown
Quick pros & cons for PHP Inspections (EA Extended)

ProAdds broad PHP inspections and quick fixes inside JetBrains IDEs.

ConIt requires a supported JetBrains IDE.

Editorially reviewed

Bug finders

Skylos

Active

Local pull-request scanning for dead code and security issues

  • Code Quality
  • PHP
  • Static Analysis
Type
Analyzer
License
Apache-2.0
Stars
945
Latest
v5.6.0
Last commit
Last release
Quick pros & cons for Skylos

ProScans pull requests locally for dead code and security issues.

ConIts broad PR checks may need repository-specific tuning.

Editorially reviewed

Bug finders

PHPStan Symfony

Active

Symfony applications that need PHPStan to understand containers, console commands, forms, Messenger, and framework return types.

  • PHP
  • PHPStan
  • Static Analysis
  • Symfony
Type
Extension
PHP
^7.4 || ^8.0
License
MIT
Pricing
Free and open source
Install
composer require --dev phpstan/phpstan-symfony
Stars
808
Latest
2.1.1
Last commit
Last release
Quick pros & cons for PHPStan Symfony

ProTeaches PHPStan about Symfony containers, console commands, forms, and Messenger.

ConAdvanced checks require generated Symfony container metadata and framework-specific setup.

Editorially reviewed

Bug finders

PHPStan Strict Rules

Active

Teams that have adopted PHPStan and want stronger correctness constraints than the default configuration.

  • PHP
  • PHPStan
  • Static Analysis
Type
Ruleset
PHP
^7.4 || ^8.0
License
MIT
Pricing
Free and open source
Install
composer require --dev phpstan/phpstan-strict-rules
Stars
716
Latest
2.1.1
Last commit
Last release
Quick pros & cons for PHPStan Strict Rules

ProEnables a maintained set of stricter correctness rules with little setup.

ConOpinionated rules can create substantial adoption work in an existing codebase.

Editorially reviewed

Active

🚀 Fast detection of composer dependency issues (unused dependencies, shadow dependencies, misplaced dependencies)

Type
Analyzer
PHP
^7.2 || ^8.0
License
MIT
Install
composer require --dev shipmonk/composer-dependency-analyser
Stars
637
Latest
1.8.4
Last commit
Last release
Quick pros & cons for composer-dependency-analyser

ProFinds unused, shadowed, and misplaced Composer dependencies.

ConIt does not replace type or behavior analysis.

Editorially reviewed

Active

PHP Magic Number Detector

  • PHP
  • Static Analysis
Type
Analyzer
PHP
^7.4 || ^8.0
License
MIT
Install
composer require --dev povils/phpmnd
Stars
586
Latest
v3.6.1
Last commit
Last release
Quick pros & cons for PHP Magic Number Detector

ProTargets unexplained numeric literals with one focused rule set.

ConTeams often need project-specific exclusions.

Editorially reviewed

Active

Large PHP applications that need framework-aware dead-code detection and optional removal.

  • Dead Code
  • PHP
  • PHPStan
  • Static Analysis
Type
Extension
PHP
1.x requires PHP 8.1+; 0.x supports PHP 7.4–8.5
License
MIT
Pricing
Free and open source
Install
composer require --dev shipmonk/dead-code-detector
Stars
540
Latest
1.4.2
Last commit
Last release
Quick pros & cons for ShipMonk Dead Code Detector

ProFinds transitive and framework-driven dead code and can remove selected findings.

ConDynamic framework behavior may still require configuration or custom usage providers.

Editorially reviewed

Active

Applications and libraries preventing new deprecated API usage during upgrades.

  • PHP
  • PHPStan
  • Static Analysis
Type
Ruleset
PHP
^7.4 || ^8.0
License
MIT
Pricing
Free and open source
Install
composer require --dev phpstan/phpstan-deprecation-rules
Stars
465
Latest
2.0.5
Last commit
Last release
Quick pros & cons for PHPStan Deprecation Rules

ProDetects deprecated APIs and supports project-defined deprecation markers.

ConIt only reports deprecations that metadata, stubs, or extensions declare.

Editorially reviewed

Bug finders

SonarQube PHPSonarQube analyzer

Active

PHP quality and security analysis in the SonarQube ecosystem

  • Code Quality
  • PHP
  • Static Analysis
Type
Analyzer
Delivery
Analyzer for SonarQube Server and SonarQube for IDE
Stars
432
Latest
4.2.0.27261
Last commit
Last release
Quick pros & cons for SonarQube PHP

ProBrings PHP quality and security rules into SonarQube.

ConIt ties analysis to the SonarQube ecosystem.

Editorially reviewed

Bug finders

php-compat-info

Active

Library that find out the minimum version and the extensions required for a piece of code to run

  • PHP
Type
Analyzer
Stars
383
Latest
7.2.7
Last commit
Last release
Quick pros & cons for php-compat-info

ProFinds the minimum PHP version and extensions code requires.

ConRuntime and environment behavior remain outside its scope.

Editorially reviewed

Active

This tool check syntax of PHP files faster than serial check with fancier output.

Type
Analyzer
PHP
>=5.3.0
Install
composer require --dev php-parallel-lint/php-parallel-lint
Stars
360
Latest
v1.4.0
Last commit
Last release
Quick pros & cons for PHP-Parallel-Lint (maintained)

ProChecks PHP syntax quickly across many files.

ConIt checks syntax only.

Editorially reviewed

Bug finders

phpstan-dba

Active

PHP applications that want SQL errors and database access-layer type problems caught during PHPStan analysis.

  • PHP
  • PHPStan
  • Sql
  • Static Analysis
Type
Extension
PHP
^7.4 || ^8.0
License
MIT
Pricing
Free and open source
Install
composer require --dev staabm/phpstan-dba
Stars
298
Latest
0.5.4
Last commit
Last release
Quick pros & cons for phpstan-dba

ProAdds SQL validation and database result type inference to an existing PHPStan workflow.

ConDatabase-specific inference adds configuration and does not replace runtime integration tests.

Editorially reviewed

Bug finders

phanalist

Active

Performant static analyzer for PHP, which is extremely easy to use. It helps you catch common mistakes in your PHP code.

  • PHP
  • Static Analysis
Type
Analyzer
License
MIT
Install
composer require --dev denzyl/phanalist
Stars
162
Latest
v1.2.1
Last commit
Last release
Quick pros & cons for phanalist

ProOffers a fast, low-setup check for common PHP mistakes.

ConIts rule set and integrations remain relatively small.

Editorially reviewed

Bug finders

PHPDoctor

Active

🏥 PHPDoctor: Check files, full directories or strings for missing or bad PHPDoc types.

  • PHP
  • Static Analysis
Type
Analyzer
PHP
>=8.1
License
Apache-2.0
Install
composer require --dev voku/phpdoctor
Stars
55
Latest
0.8.0
Last commit
Last release
Quick pros & cons for PHPDoctor

ProFinds missing or inconsistent PHPDoc types.

ConIt covers PHPDoc types, not general correctness.

Editorially reviewed

Active

Fast & simple tool to find class duplicates in your projects.

  • PHP
Type
Analyzer
PHP
^7.2 || ^8.0
License
MIT
Install
composer require --dev shipmonk/name-collision-detector
Stars
35
Latest
2.1.1
Last commit
Last release
Quick pros & cons for name-collision-detector

ProFinds duplicate class names with a narrow, fast check.

ConIt checks duplicate names, not wider code quality.

Editorially reviewed

Bug finders

PHP Analysis

Active

PHP language analyses in Rascal

Type
Analyzer
License
BSD-2-Clause
Stars
28
Latest
v0.3.6
Last commit
Last release
Quick pros & cons for PHP Analysis

ProSupports custom PHP language research in Rascal.

ConIt requires Rascal and targets specialist use cases.

Editorially reviewed

Bug finders

noverify

Inactive

Pretty fast linter (code static analysis utility) for PHP

  • PHP
Type
Analyzer
PHP
>=7.1
License
MIT
Install
composer require --dev vkcom/noverify
Stars
693
Latest
v0.5.5
Last commit
Last release
Quick pros & cons for noverify

ProRuns PHP lint checks quickly from a standalone binary.

ConIts rule ecosystem is smaller than PHP-native leaders.

Editorially reviewed

Inactive

Static type checker for PHP relying on the php-ast PECL extension. Mirrored from Codeberg.org

Type
Analyzer
Stars
0
Latest
-
Last commit
Last release
Unknown
Quick pros & cons for PHP Static Type Checker

ProProvides focused type checks through PHP's native AST.

ConIt depends on php-ast and has a small ecosystem.

Editorially reviewed

Bug finders

Progpilot

Unmaintained

A static analysis tool for security

  • PHP
Type
Analyzer
PHP
>=8.3
License
MIT
Install
composer require --dev designsecurity/progpilot
Stars
371
Latest
v1.3.0
Last commit
Last release
Quick pros & cons for Progpilot

ProTracks tainted data to find PHP security flaws.

ConSecurity findings need framework-aware tuning and review.

Editorially reviewed