PHPStan
Hacker ApprovedRanked 4 of 12 static analyzers by recommenders
Free open-source static analysis tool for PHP that people say catches most issues before runtime and handles type definitions well.
Free open-source static analysis tool for PHP that people say catches most issues before runtime and handles type definitions well.
11 people gave an opinion
- recommend it
- 11
- criticize it
- 0
- approval share
- 100%
Recommended in 7 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: recommended
- March 2026: not recommended
- April 2026: not recommended
- May 2026: recommended
- June 2026: not recommended
- July 2026: recommended
- August 2026: recommended
- September 2026: not recommended
- October 2026: not recommended
- November 2026: not recommended (month in progress)
Why it carries the badge
- 11 people recommend itNeeds 10 or more, met.
- Nobody criticizes itNeeds 2 to 1 or better, met.
- Recommended in 7 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
Handles type definitions well
“Phpstan deals well with type definitions”
Comment from 23 May 2026 in “PHP's Oddities” “Tools like PHPStan work fine, but I'd love a typed language on top of PHP”
Comment from 9 Jul 2026 in “TypeScript 7” Catches issues before runtime
“PHPstan catches 99% of issues before the runtime gets to it”
Comment from 20 Nov 2025 in “PHP 8.5” “enforced by PHPStan (static analysis) at level max for rock‑solid reliability”
Comment from 26 Dec 2025 in “Show HN: Open source, self-hosted AI nutritionist for diabetes (Laravel/React)” Popular standard tool for PHP
“PHPStan is one of the more popular tools to evaluate that stuff.”
Comment from 28 May 2026 in “PHP's Oddities” “Just add phpcsfixer and phpstan like any sane project”
Comment from 7 May 2026 in “Show HN: PHP-fts – Full-text search engine in pure PHP, no extensions”
Other static analyzers people recommend
The four most recommended other static analyzers, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| zizmor | 19 | 1 | 95% | 6 | — | Approved |
| Semgrep | 14 | 10 | 58% | 7 | — | — |
| clang-tidy | 14 | 4 | 78% | 6 | — | Approved |
| PHPStanThis page | 11 | 0 | 100% | 7 | — | Approved |
| SonarQube | 10 | 13 | 43% | 6 | — | — |
What people said
9 of the 11 comments that mention it, newest first. Each links to the original comment.
“Tools like PHPStan work fine, but I'd love a typed language on top of PHP”
“PHPStan is one of the more popular tools to evaluate that stuff.”
“phpdoc syntax should work with static analysis tools”
“Phpstan deals well with type definitions”
“Just add phpcsfixer and phpstan like any sane project”
“callable and iterable are pretty powerful, convenient, and safe”
“Psalm has credible alternatives in PHPStan and now Mago”
“enforced by PHPStan (static analysis) at level max for rock‑solid reliability”
“PHPstan catches 99% of issues before the runtime gets to it”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.