# phan/phan

Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.

Repository: https://github.com/phan/phan
Canonical: https://ross.abutalabs.com/products/phan
Homepage: https://github.com/phan/phan/wiki
Language: PHP
License: NOASSERTION
License Family: other
Topics: php, static-analysis, phan, analysis, analyzer, static-code-analysis
Last push: 2026-08-26T12:22:28+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 89, longevity 100
- inputs: {"age_days": 3968, "days_push": 7, "days_rel": 72, "gap_med": 23, "n_releases_24m": 12}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5623, forks 367 (observed 2026-08-28T04:09:23.105652+00:00)

## What it is
Phan is a static analyzer for PHP that finds bugs in code before it runs, focusing on type compatibility checking and minimizing false positives. It proves incorrectness rather than correctness and supports analyzing PHP 8.1-8.5 syntax.

## Use cases
- find bugs in php code before running it
- static type checking for php project
- catch undefined variables and dead code in php
- verify php code compatibility with php 8.1-8.5
- incrementally add static analysis to a legacy php codebase
- check phpdoc annotations and type safety in php

## When to choose
- you maintain a PHP codebase and want to catch type errors and bugs before runtime
- you want a low-false-positive analyzer that can be introduced incrementally
- you need to verify compatibility with newer PHP syntax versions

## When to avoid
- you need a general-purpose linter for code style rather than bug detection
- your project is not written in PHP
- you cannot install the php-ast extension and need exact doc comment parsing

## Facets
- artifact type: cli-tool
- maturity: active
- function: testing, linter, developer-tools
- domain: developer-tools, programming-languages, testing
- platform: php, cli, cross-platform
- tags: static-analysis, php, type-checking, code-quality, bug-detection

## Member repositories
- phan/phan (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:23.105652+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:55:22.691569+00:00, confidence not recorded.
  - readme: https://github.com/phan/phan (fetched 2026-08-28T04:09:23.105652+00:00, sha 4825d58222f1)
  - homepage: https://github.com/phan/phan/wiki (fetched 2026-08-29T08:49:59.828692+00:00, sha 57ccc01acb89)
- Data as of 2026-08-30T08:39:29.467469+00:00.
