CheckOps
PHPStan
PHPStan is an MIT PHP static analysis tool that finds bugs without running code, using rule levels from 0 to 10 and a baseline for gradual adoption.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
PHPStan discovers bugs in PHP code without running it. It reads code and PHPDoc types and reports errors such as calling undefined methods, passing wrong argument types, accessing possibly-null values and dead code.
Strictness is controlled by rule levels, from 0 (basic checks) up to 10 (the strictest). A baseline file records existing errors so new code is held to a higher standard while legacy errors are fixed over time. Extensions add framework knowledge for Symfony, Laravel (via Larastan), Doctrine and PHPUnit.
In the quality loop PHPStan is a core static gate for PHP projects.
The source code is at phpstan/phpstan on GitHub under the MIT licence, with about 14,200 stars; the most recent commit was on 11 November 2026.
Features
- Rule levels: Levels 0 to 10.
- Baseline: Ignore existing errors while blocking new ones.
- Generics: Advanced PHPDoc types and generics.
- Framework extensions: Symfony, Laravel, Doctrine and more.
- Custom rules: Write project rules.
- Result cache: Fast repeated runs.
Pros
- Gradual adoption: Levels and baselines make it easy to start.
- Free to use: Open source under the MIT licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 11 November 2026.
- Community: About 14,200 GitHub stars.
Cons
- PHPDoc reliance: Weakly typed code needs annotations.
- Magic code: Framework magic needs extensions.
- Memory use: Large projects need memory tuning.
Usage and Links (Example)
composer require --dev phpstan/phpstan
vendor/bin/phpstan analyse src --level 6
vendor/bin/phpstan analyse --generate-baseline
Resources:
Pricing
PHPStan is free and open source under the MIT licence.
Recommended for?
- PHP teams wanting type-level bug detection.
- Legacy PHP codebases improving gradually.
Conclusion
PHPStan is the leading static analyser for PHP.
Raise the level step by step and keep the baseline shrinking.
On CheckOps, PHPStan is filed under the Release & CI gates stage. Related tools listed here include Psalm, PHPUnit, Infection, SonarQube, Semgrep and Pest. Which one fits best depends mostly on your stack, your team’s size and skills, and whether you prefer to run tools yourself or pay for a managed service. This page reflects the official website, documentation and repository as they stood on 11 November 2026.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with PHPStan side by side.
PPsalmPsalm is an MIT PHP static analysis tool for finding type errors and security vulnerabilities, including taint analysis for injection flaws.Compare with PHPStan
PPHPUnitPHPUnit is the BSD-3-Clause, programmer-oriented testing framework for PHP and an instance of the xUnit architecture, created by Sebastian Bergmann and distributed as a PHAR or via Composer.Compare with PHPStan
IInfectionInfection is a BSD-3-Clause AST-based mutation testing framework for PHP that measures test effectiveness with Mutation Score Indicator metrics, supporting PHPUnit, Pest, Codeception and phpspec.Compare with PHPStan
SSonarQubeModernize your AI workflows with code verification for the agentic era.Compare with PHPStan
SSemgrepSemgrep is a fast static-analysis engine with a free open-source CLI and a paid platform for cross-file rules, supply chain, and secrets.Compare with PHPStan
PPestPest is an MIT-licensed PHP testing framework built on PHPUnit with an expressive, closure-based API; Pest 5 (PHP 8.4+, PHPUnit 13) adds the Tia engine, an agent plugin, evals, PHPStan and Rector support.Compare with PHPStan