# PHPStan

11 Hacker News commenters recommended PHPStan and 0 criticized it, November 2025 to November 2026. It was recommended in 7 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** Free open-source static analysis tool for PHP that people say catches most issues before runtime and handles type definitions well.

## Why people recommend it

- Handles type definitions well (2 comments): "Phpstan deals well with type definitions" ([source](https://news.ycombinator.com/item?id=48248888)) "Tools like PHPStan work fine, but I'd love a typed language on top of PHP" ([source](https://news.ycombinator.com/item?id=48842447))
- Catches issues before runtime (2 comments): "PHPstan catches 99% of issues before the runtime gets to it" ([source](https://news.ycombinator.com/item?id=45992994)) "enforced by PHPStan (static analysis) at level max for rock‑solid reliability" ([source](https://news.ycombinator.com/item?id=46397010))
- Popular standard tool for PHP (2 comments): "PHPStan is one of the more popular tools to evaluate that stuff." ([source](https://news.ycombinator.com/item?id=48306653)) "Just add phpcsfixer and phpstan like any sane project" ([source](https://news.ycombinator.com/item?id=48046312))

## Alternatives hackers recommend

- [zizmor](https://hackerapproved.com/p/zizmor.md): 19 recommend
- [Semgrep](https://hackerapproved.com/p/semgrep.md): 14 recommend
- [clang-tidy](https://hackerapproved.com/p/clang-tidy.md): 14 recommend
- [SonarQube](https://hackerapproved.com/p/sonarqube.md): 10 recommend
- [CodeQL](https://hackerapproved.com/p/codeql.md): 9 recommend

## Cite as

Hacker Approved, "PHPStan", https://hackerapproved.com/p/phpstan/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
