A static analyzer for PHP that minimizes false positives by attempting to prove incorrectness rather than correctness.
Phan is a static analyzer for PHP that detects bugs, type errors, dead code, and compatibility issues in PHP codebases without executing the program. It analyzes source code to identify potential problems early in the development cycle, helping developers maintain code quality and prevent runtime failures.
PHP developers and teams working on medium to large codebases who want to improve code reliability, enforce type safety, and catch bugs before deployment. It's especially useful for projects adopting modern PHP features or maintaining legacy code.
Developers choose Phan for its low false-positive rate, extensive PHP version support, and flexible configuration that allows incremental adoption. Its plugin system and editor integration make it a versatile tool for continuous code quality improvement.
Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Phan's philosophy is to prove incorrectness rather than correctness, reducing noise and making it practical for real-world codebases as emphasized in the README.
It checks type safety and compatibility across PHP 8.1 to 8.5, helping maintain code quality during version upgrades, as noted in the features section.
Plugins allow adding custom checks for regex validation, printf formats, and coding style, extending analysis beyond core features, with examples listed in the plugins directory.
Can run on multiple cores using pcntl, speeding up analysis for large projects, which is highlighted as a key feature in the README.
Requires the php-ast extension for optimal parsing, adding an installation step and potential compatibility issues, especially in constrained environments.
The README admits it has a 'good but not comprehensive' understanding of flow control, limiting value tracking in complex dynamic scenarios.
Setting up involves creating and managing a .phan/config.php file with directory lists and plugins, which can be daunting for beginners or large, messy codebases.