Selection guide

PHPStan vs Psalm: choosing a PHP static analyzer

Compare gradual type checking, framework support, taint analysis, and adoption costs when choosing PHPStan or Psalm.

Start with the checks your application needs

Both tools analyze PHP source to find type errors and bugs. The useful comparison is how well each understands your application and how much configuration and annotation work the team can maintain.

Try one analyzer on a representative module before adding it to CI. Include framework integrations, database access, and dynamic code; review whether findings describe defects you can act on. This is the catalog's suggested evaluation approach, rather than a performance ranking.

PHPStan: gradual checks and framework extensions

PHPStan offers cumulative rule levels so teams can increase strictness gradually. A baseline can separate existing findings from new ones while the team improves the codebase.

Framework extensions help PHPStan understand conventions that ordinary PHP types do not describe. Check extension compatibility before choosing the analyzer version for a Laravel, Symfony, or Doctrine project. Higher strictness can require additional type information and configuration.

Official documentation:

Psalm: types and tainted-data analysis

Psalm combines type checking with a taint-analysis mode that follows untrusted data toward sensitive operations. If this is part of your security workflow, evaluate it using the actual entry points and sinks in your application.

Advanced type modelling and security checks still need accurate annotations and configuration. Static analysis supports a security review; it does not establish that an application is free of vulnerabilities.

Official documentation:

Make the adoption cost visible

Record the required PHP version, framework support, findings that need fixing, baseline size, and time needed to configure a trial. Use the current catalog records below for installation and compatibility; verify the final setup against the project's documentation.

Start with the analyzer that gives your team useful, maintainable feedback. Add a second analyzer only when its additional findings justify the extra configuration and CI work.