# phpstan/phpstan

PHP Static Analysis Tool - discover bugs in your code without running it!

Repository: https://github.com/phpstan/phpstan
Canonical: https://ross.abutalabs.com/products/phpstan
Homepage: https://phpstan.org/
Language: PHP
License: MIT
License Family: permissive
Topics: phpstan, static-analysis, php, php7, testing, static-code-analysis, static-analyzer
Last push: 2026-08-26T21:15:57+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 3894, "days_push": 7, "days_rel": 11, "gap_med": 3, "n_releases_24m": 106}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 14082, forks 962 (observed 2026-08-28T04:11:05.456332+00:00)

## What it is
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
- artifact type: cli-tool
- maturity: stable
- function: testing, linter, developer-tools, type-system
- domain: developer-tools, testing, programming-languages
- platform: cli, cross-platform, php
- tags: static-analysis, php, code-quality, phpdocs, generics, ci, baseline

## Member repositories
- phpstan/phpstan (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:05.456332+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:12:50.061333+00:00, confidence not recorded.
  - readme: https://github.com/phpstan/phpstan (fetched 2026-08-28T04:11:05.456332+00:00, sha 8d37df225c8d)
  - homepage: https://phpstan.org/ (fetched 2026-08-29T08:06:41.746853+00:00, sha 8164887d741d)
  - site_page: https://phpstan.org/documentation (fetched 2026-08-29T08:06:41.755702+00:00, sha baec664264e7)
  - site_page: https://phpstan.org/blog/generics-in-php-using-phpdocs (fetched 2026-08-29T08:06:41.760322+00:00, sha 4fac13af3f5f)
  - site_page: https://phpstan.org/writing-php-code/phpdocs-basics (fetched 2026-08-29T08:06:41.762859+00:00, sha 42d8578a32b4)
  - site_page: https://phpstan.org/blog/introducing-phpstan-pro (fetched 2026-08-29T08:06:41.758097+00:00, sha efcc3f62b719)
- Data as of 2026-08-30T08:39:29.467469+00:00.
