phpstan/phpstan
PHP Static Analysis Tool - discover bugs in your code without running it! observed · 2026-08-28
Health v2 · maintenance only
95/100
- Activity 99
- Release rhythm 87
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 3
- age_days: 3894
- days_rel: 11
- days_push: 7
- n_releases_24m: 106
Adoption not part of the score
14082 stars · 962 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
PHPStan is an open-source static analysis tool for PHP that discovers bugs in code without running it. It understands PHPDocs, supports generics and array shapes via annotations, and offers gradual adoption through rule levels and baselines.
Use cases
- find bugs in PHP code without running it
- run static analysis in CI to catch errors before production
- adopt gradual type checking on a legacy PHP codebase with a baseline
- check types and generics expressed in PHPDocs
- analyze Symfony, Laravel, or Doctrine code with framework extensions
- get CI-friendly analysis output in JSON or JUnit format
When to choose
- you maintain a PHP codebase and want to catch bugs before tests or runtime
- you want to incrementally improve type safety in legacy PHP code
- you need static analysis integrated into CI pipelines
- you want richer type checking (generics, array shapes) than native PHP type hints provide
When to avoid
- your project is not written in PHP
- you need runtime profiling, performance monitoring, or dynamic testing rather than static analysis
- you want an IDE-only linter without a standalone analyzer
Facets
cli-tool · maturity stable
testing linter developer-tools type-system developer-tools testing programming-languages cli cross-platform php static-analysis php code-quality phpdocs generics ci baseline
6 sources
- readme: https://github.com/phpstan/phpstan · fetched 2026-08-28 · 8d37df225c8d
- homepage: https://phpstan.org/ · fetched 2026-08-29 · 8164887d741d
- site_page: https://phpstan.org/documentation · fetched 2026-08-29 · baec664264e7
- site_page: https://phpstan.org/blog/generics-in-php-using-phpdocs · fetched 2026-08-29 · 4fac13af3f5f
- site_page: https://phpstan.org/writing-php-code/phpdocs-basics · fetched 2026-08-29 · 42d8578a32b4
- site_page: https://phpstan.org/blog/introducing-phpstan-pro · fetched 2026-08-29 · efcc3f62b719
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| phpstan/phpstan | main | 95 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem