Phan is a static analyzer for PHP. Phan prefers to avoid false positives and attempts to prove incorrectness rather than correctness. Phan looks for common issues and will verify type compatibility on various operations when type information is available or can be deduced. Phan has a good (but not comprehensive) understanding of flow control and can track values in a few use cases (e.g. arrays, integers, and strings). With Phan installed, you'll want to create a .phan/config.php file in your project to tell Phan how to analyze your source code. Phan 5 depends on PHP 7.2+ with the php-ast extension (1.0.16+ is preferred) and supports analyzing PHP version 7.0-8.1 syntax. Check that all methods, functions, classes, traits, interfaces, constants, properties and variables are defined and accessible. Check for type safety and arity issues on method/function/closure calls.

Features

  • Check for PHP8/PHP7/PHP5 backward compatibility
  • Check that all methods, functions, classes, traits, interfaces, constants, properties and variables are defined and accessible
  • Check for type safety and arity issues on method/function/closure calls
  • Check for features that weren't supported in older PHP 7.x minor releases
  • Check for sanity with array accesses
  • Check for type safety on binary operations

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Phan

Phan Web Site

Other Useful Business Software
Deploy Apps in Seconds with Cloud Run Icon
Deploy Apps in Seconds with Cloud Run

Host and run your applications without the need to manage infrastructure. Scales up from and down to zero automatically.

Cloud Run is the fastest way to deploy containerized apps. Push your code in Go, Python, Node.js, Java, or any language and Cloud Run builds and deploys it automatically. Get fast autoscaling, pay only when your code runs, and skip the infrastructure headaches. Two million requests free per month. And new customers get $300 in free credit.
Try Cloud Run Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Phan!

Additional Project Details

Operating Systems

Windows

Programming Language

PHP

Related Categories

PHP Static Code Analysis Tool

Registered

2023-03-30