LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

phan

PHP static analyzer

TLDR

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

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.

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)

Copied to clipboard
Kai