27 tools. Editor picks appear first; review the requirements and trade-offs of each tool.
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
⭐ Stars14,160
Latest 2.3.6
Last commit 2026-11-15
Last release 2026-11-15
Quick pros & cons for PHPStan
Pro Pairs mature type analysis with a large extension ecosystem.
Con Higher rule levels often need annotations and gradual adoption.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
A PHP static analysis tool for finding errors and security vulnerabilities in PHP applications
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
⭐ Stars5,931
Latest 7.7.0
Last commit 2026-11-16
Last release 2026-11-16
Quick pros & cons for psalm
Pro Combines expressive types with taint and security analysis.
Con Advanced checks add annotation and configuration work.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
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
⭐ Stars6,560
Latest v5.4.3
Last commit 2026-11-14
Last release 2026-11-08
Quick pros & cons for jscpd
Pro Detects duplication across PHP and hundreds of other formats.
Con Generated code and boilerplate need threshold tuning.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
Type Analyzer
PHP ^8.1.0
Install composer require --dev phan/phan
⭐ Stars5,621
Latest 6.0.11
Last commit 2026-11-16
Last release 2026-10-15
Quick pros & cons for Phan
Pro Prioritizes low false-positive AST-based type analysis.
Con It requires the php-ast extension and careful configuration.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Mago is a toolchain for PHP that aims to provide a set of tools to help developers write better code.
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
⭐ Stars3,560
Latest 1.60.2
Last commit 2026-11-16
Last release 2026-11-16
Quick pros & cons for mago
Pro Combines fast linting, analysis, and formatting in one toolchain.
Con Its ecosystem is younger than established PHP analyzers.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
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.
Type Analyzer
PHP >=5.3.9
License BSD-3-Clause
Install composer require --dev phpmd/phpmd
⭐ Stars2,465
Latest 3.0.0
Last commit 2026-11-10
Last release 2026-10-04
Quick pros & cons for PHP Mess Detector
Pro Catches complexity, naming, and maintainability problems.
Con Default rules can be noisy on existing codebases.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
PHP Compatibility check for PHP_CodeSniffer
Type Ruleset
PHP >=5.3
License LGPL-3.0
Install composer require --dev phpcompatibility/php-compatibility
⭐ Stars2,315
Latest 9.3.5
Last commit 2026-11-06
Last release 2019-12-27
Quick pros & cons for PHP Compatibility
Pro Checks code against a target PHP version range.
Con It needs PHP_CodeSniffer and cannot prove runtime compatibility.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Show unused composer dependencies by scanning your code
Type Analyzer
PHP ^8.1
License MIT
Install composer require --dev icanhazstring/composer-unused
⭐ Stars1,694
Latest 0.9.8
Last commit 2026-11-02
Last release 2026-10-31
Quick pros & cons for Composer-Unused
Pro Quickly flags Composer packages that code may not use.
Con Dynamic package use may require exclusions.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Deep PHP code inspections directly in JetBrains IDEs
Type Extension
Delivery PhpStorm and IntelliJ IDEA Ultimate plugin
⭐ Stars1,485
Latest -
Last commit 2026-08-28
Last release Unknown
Quick pros & cons for PHP Inspections (EA Extended)
Pro Adds broad PHP inspections and quick fixes inside JetBrains IDEs.
Con It requires a supported JetBrains IDE.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Local pull-request scanning for dead code and security issues
Code Quality PHP Static Analysis
Type Analyzer
License Apache-2.0
⭐ Stars945
Latest v5.6.0
Last commit 2026-11-16
Last release 2026-11-11
Quick pros & cons for Skylos
Pro Scans pull requests locally for dead code and security issues.
Con Its broad PR checks may need repository-specific tuning.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
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
⭐ Stars808
Latest 2.1.1
Last commit 2026-11-12
Last release 2026-10-26
Quick pros & cons for PHPStan Symfony
Pro Teaches PHPStan about Symfony containers, console commands, forms, and Messenger.
Con Advanced checks require generated Symfony container metadata and framework-specific setup.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
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
⭐ Stars716
Latest 2.1.1
Last commit 2026-11-12
Last release 2026-11-02
Quick pros & cons for PHPStan Strict Rules
Pro Enables a maintained set of stricter correctness rules with little setup.
Con Opinionated rules can create substantial adoption work in an existing codebase.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
🚀 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
⭐ Stars637
Latest 1.8.4
Last commit 2026-11-03
Last release 2025-11-25
Quick pros & cons for composer-dependency-analyser
Pro Finds unused, shadowed, and misplaced Composer dependencies.
Con It does not replace type or behavior analysis.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
PHP Magic Number Detector
Type Analyzer
PHP ^7.4 || ^8.0
License MIT
Install composer require --dev povils/phpmnd
⭐ Stars586
Latest v3.6.1
Last commit 2026-10-10
Last release 2026-02-21
Quick pros & cons for PHP Magic Number Detector
Pro Targets unexplained numeric literals with one focused rule set.
Con Teams often need project-specific exclusions.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
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
⭐ Stars540
Latest 1.4.2
Last commit 2026-11-06
Last release 2026-09-21
Quick pros & cons for ShipMonk Dead Code Detector
Pro Finds transitive and framework-driven dead code and can remove selected findings.
Con Dynamic framework behavior may still require configuration or custom usage providers.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
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
⭐ Stars465
Latest 2.0.5
Last commit 2026-11-12
Last release 2026-07-27
Quick pros & cons for PHPStan Deprecation Rules
Pro Detects deprecated APIs and supports project-defined deprecation markers.
Con It only reports deprecations that metadata, stubs, or extensions declare.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
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
⭐ Stars432
Latest 4.2.0.27261
Last commit 2026-11-16
Last release 2026-10-27
Quick pros & cons for SonarQube PHP
Pro Brings PHP quality and security rules into SonarQube.
Con It ties analysis to the SonarQube ecosystem.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Library that find out the minimum version and the extensions required for a piece of code to run
Type Analyzer
⭐ Stars383
Latest 7.2.7
Last commit 2026-10-31
Last release 2026-10-31
Quick pros & cons for php-compat-info
Pro Finds the minimum PHP version and extensions code requires.
Con Runtime and environment behavior remain outside its scope.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
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
⭐ Stars360
Latest v1.4.0
Last commit 2026-10-25
Last release 2024-03-27
Quick pros & cons for PHP-Parallel-Lint (maintained)
Pro Checks PHP syntax quickly across many files.
Con It checks syntax only.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
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
⭐ Stars298
Latest 0.5.4
Last commit 2026-11-13
Last release 2026-11-06
Quick pros & cons for phpstan-dba
Pro Adds SQL validation and database result type inference to an existing PHPStan workflow.
Con Database-specific inference adds configuration and does not replace runtime integration tests.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Performant static analyzer for PHP, which is extremely easy to use. It helps you catch common mistakes in your PHP code.
Type Analyzer
License MIT
Install composer require --dev denzyl/phanalist
⭐ Stars162
Latest v1.2.1
Last commit 2026-11-10
Last release 2026-11-03
Quick pros & cons for phanalist
Pro Offers a fast, low-setup check for common PHP mistakes.
Con Its rule set and integrations remain relatively small.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
🏥 PHPDoctor: Check files, full directories or strings for missing or bad PHPDoc types.
Type Analyzer
PHP >=8.1
License Apache-2.0
Install composer require --dev voku/phpdoctor
⭐ Stars55
Latest 0.8.0
Last commit 2026-09-24
Last release 2026-04-26
Quick pros & cons for PHPDoctor
Pro Finds missing or inconsistent PHPDoc types.
Con It covers PHPDoc types, not general correctness.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Fast & simple tool to find class duplicates in your projects.
Type Analyzer
PHP ^7.2 || ^8.0
License MIT
Install composer require --dev shipmonk/name-collision-detector
⭐ Stars35
Latest 2.1.1
Last commit 2026-10-25
Last release 2024-03-01
Quick pros & cons for name-collision-detector
Pro Finds duplicate class names with a narrow, fast check.
Con It checks duplicate names, not wider code quality.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
PHP language analyses in Rascal
Type Analyzer
License BSD-2-Clause
⭐ Stars28
Latest v0.3.6
Last commit 2026-10-15
Last release 2026-10-15
Quick pros & cons for PHP Analysis
Pro Supports custom PHP language research in Rascal.
Con It requires Rascal and targets specialist use cases.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Pretty fast linter (code static analysis utility) for PHP
Type Analyzer
PHP >=7.1
License MIT
Install composer require --dev vkcom/noverify
⭐ Stars693
Latest v0.5.5
Last commit 2026-01-19
Last release 2025-04-22
Quick pros & cons for noverify
Pro Runs PHP lint checks quickly from a standalone binary.
Con Its rule ecosystem is smaller than PHP-native leaders.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
Static type checker for PHP relying on the php-ast PECL extension. Mirrored from Codeberg.org
Type Analyzer
⭐ Stars0
Latest -
Last commit 2026-04-08
Last release Unknown
Quick pros & cons for PHP Static Type Checker
Pro Provides focused type checks through PHP's native AST.
Con It depends on php-ast and has a small ecosystem.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08
A static analysis tool for security
Type Analyzer
PHP >=8.3
License MIT
Install composer require --dev designsecurity/progpilot
⭐ Stars371
Latest v1.3.0
Last commit 2025-08-17
Last release 2025-08-17
Quick pros & cons for Progpilot
Pro Tracks tainted data to find PHP security flaws.
Con Security findings need framework-aware tuning and review.
Evidence: Source 1 ↗
Editorially reviewed 2026-08-08