Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Psalm

Psalm is a static analysis tool for PHP, developed to find type errors and bugs by reading docblock type annotations and inferring types across the codebase without running it.

Psalm is able to:

  • Detect type errors, dead code, and impossible conditions
  • Infer and check the generics-like docblock type language used across the PHP ecosystem, including template covariance and conditional types
  • Enforce increasingly strict checking through configurable error levels
  • Perform taint analysis to trace untrusted input through the codebase
  • Run in continuous integration alongside tools such as PHPStan.

Documentation

See Also