phan

PHP static analyzer

TLDR

Analyze PHP project
$ phan
Analyze specific directory
$ phan --directory [src/]
Generate baseline
$ phan --save-baseline [.phan/baseline.php]
Use baseline
$ phan --load-baseline [.phan/baseline.php]
Output format
$ phan --output-mode [json]

SYNOPSIS

phan [options]

DESCRIPTION

phan is a PHP static analyzer. Finds bugs through type checking.The tool performs deep analysis. Supports PHP 7/8 features.

PARAMETERS

--directory DIR

Directory to analyze.
--config-file FILE
Configuration file.
--save-baseline FILE
Save baseline.
--load-baseline FILE
Load baseline.
--output-mode FORMAT
Output format.
--help
Display help.

INSTALL

yay -S phan

CAVEATS

Requires PHP with AST extension. Configuration recommended.

HISTORY

Phan was created for advanced PHP static analysis with type inference.

SEE ALSO

phpstan(1), psalm(1), php(1)