| What it is | Free and open source static analysis tool for finding errors in PHP code | PHP static analysis that finds bugs without running your code | A static analyzer for PHP that minimizes false positives | Adds code analysis to Laravel, improving developer productivity and code quality |
| Features | - type checking with docblock generics and array shapes
- strictness levels from loose to strict
- taint analysis for SQL injection, XSS and other vulnerabilities
- automatic fixes for many issues
- plugins for frameworks and libraries
- online playground
- IDE support
- GitHub Actions for analysis and security scans (SARIF to code scanning)
- All 10 features
| - whole-codebase static analysis
- rule levels 0 to 10
- baseline for existing errors
- generics and array shapes in PHPDoc
- framework extensions for Symfony, Laravel and Doctrine
- result cache and parallel analysis
- PHPStan Pro web UI
| - type safety and arity checks on calls, operations and return values
- backward compatibility checks for PHP 8.1 to 8.6
- dead, unreachable and unused code detection, with automatic fixes for some issues
- union types, generics (@template), array shapes and PHPDoc annotations
- user and bundled plugins
- editor integration through the Language Server Protocol and a daemon mode
| - PHPStan extension for Laravel apps
- supports most of Laravel's magic
- finds bugs before tests are written
|