Need advice about which tool to choose?Ask the StackShare community!

PHPStan

81
48
+ 1
0
Psalm

12
18
+ 1
0
Add tool

PHPStan vs Psalm: What are the differences?

Developers describe PHPStan as "PHP Static Analysis Tool - discover bugs in your code without running it!". It focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line. On the other hand, Psalm is detailed as "Open-source static analysis tool for PHP (By Vimeo)". It is a type-checking static analysis tool for PHP that finds bugs humans can miss, and improves code quality. It is designed to be useful on both large legacy codebases and small, modern ones. It can help you prevent the vast majority of type-related runtime errors, and also enables you to take advantage of safe coding patterns popular in other languages.

PHPStan and Psalm can be primarily classified as "Code Review" tools.

Some of the features offered by PHPStan are:

  • Static Analysis Tool
  • Focuses on finding errors in your code without actually running it
  • Extensible

On the other hand, Psalm provides the following key features:

  • Open-source
  • Static analysis tool
  • Identify both obvious and hard-to-spot bugs in your code

PHPStan and Psalm are both open source tools. It seems that PHPStan with 8.86K GitHub stars and 643 forks on GitHub has more adoption than Psalm with 3.16K GitHub stars and 264 GitHub forks.

Get Advice from developers at your company using Private StackShare. Sign up for Private StackShare.
Learn More

Sign up to add or upvote prosMake informed product decisions

Sign up to add or upvote consMake informed product decisions

What is PHPStan?

It focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line.

What is Psalm?

It is a type-checking static analysis tool for PHP that finds bugs humans can miss, and improves code quality. It is designed to be useful on both large legacy codebases and small, modern ones. It can help you prevent the vast majority of type-related runtime errors, and also enables you to take advantage of safe coding patterns popular in other languages.

Need advice about which tool to choose?Ask the StackShare community!

What companies use PHPStan?
What companies use Psalm?
See which teams inside your own company are using PHPStan or Psalm.
Sign up for Private StackShareLearn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with PHPStan?
What tools integrate with Psalm?

Sign up to get full access to all the tool integrationsMake informed product decisions

What are some alternatives to PHPStan and Psalm?
SonarQube
SonarQube provides an overview of the overall health of your source code and even more importantly, it highlights issues found on new code. With a Quality Gate set on your project, you will simply fix the Leak and start mechanically improving.
ESLint
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Prettier
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
TSLint
An extensible static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors. It is widely supported across modern editors & build systems and can be customized with your own lint rules, configurations, and formatters.
Snyk
Automatically find & fix vulnerabilities in your code, containers, Kubernetes, and Terraform
See all alternatives