A static analysis tool for PHP

View on GitHub

Life is complicated. PHP can be, too. Psalm is designed to under­stand that complexity, so it can quickly pinpoint type errors in your codebase.

You should use Psalm if you run PHP 5.6+ or PHP 7.0+, and:

Quickstart Guide

Install via Composer or download via GitHub:

composer require --dev vimeo/psalm

Add a config:

./vendor/bin/psalm --init

Then run Psalm:


The config created above will show you all issues in your code, but will emit INFO issues (as opposed to ERROR) for certain common trivial code problems. If you want a more lenient config you can specify the level with

./vendor/bin/psalm --init [source_dir] [level]

You can also learn how to suppress certain issues.

Want to know more? Check out the docs!