awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
phan avatar

phan/phan

0
View on GitHub↗
5,617 stars·370 forks·PHP·29 viewsgithub.com/phan/phan/wiki↗

Phan

Phan is a static analyzer and type checker for PHP that identifies bugs and type incompatibilities without executing the code. It serves as a quality gate for continuous integration pipelines and a tool for verifying type safety, specifically checking union types, generics, and array shapes.

The project is distinguished by its use of a background daemon and Language Server Protocol implementation, which provide real-time diagnostics and navigation within editors. It also features a baseline-based suppression system that allows developers to record existing errors in a snapshot file to focus exclusively on new regressions.

The analysis engine covers a wide range of capabilities including dead code detection, language compatibility validation across different PHP versions, and the inference of variable and template types. It supports extensible analysis through a plugin system and provides automated code fixes for a subset of detected issues.

Users can bootstrap the process by generating a configuration file with selectable strictness levels to gradually validate their codebase.

Features

  • Type Safety - Analyze union types, generics, array shapes, and nullability to identify type incompatibilities and potential bugs.
  • PHP Type Checkers - Finding bugs and type incompatibilities in PHP code without running the application.
  • Code Quality and Analysis - Identifies dead code, unreachable blocks, and undefined variables to improve overall codebase health.
  • IDE Real-time Feedback - Delivers real-time analysis results and remediation guidance directly within the code editor.
  • Language Server Protocol Implementations - A background daemon that provides real-time PHP analysis and IDE integration via a standard protocol.
  • Language Server Protocols - Implements the Language Server Protocol to provide real-time diagnostics and navigation in editors.
  • CI/CD Pipeline Integrations - Provides native support for automating quality checks and build failures within CI/CD pipelines.
  • Dead Code Analysis - Detects unreachable code, unused variables, and redundant conditions to eliminate dead code.
  • Type Inference Refinement - Deduce the type of a variable based on inline assertions or conditional branches to refine type checking.
  • Dead Code Detection - Identifying unused variables, unreachable code blocks, and redundant conditions to clean up PHP codebases.
  • Type Inference Support - Determine variable types by analyzing assert statements and conditional logic within loops or branches.
  • Type Annotations - Parses and verifies PHPDoc annotations for union types, generics, and array shapes.
  • Type Checking - Warn when any type within a union cannot be cast to an expected type for method invocations.
  • Common Bug Detection - Detects semantic bugs, type incompatibilities, and unsafe type usage in real time during development.
  • Issue Baselining - Records known errors into a baseline snapshot to filter out legacy warnings and identify new regressions.
  • Static Type Checking - Check that assigned values and return types match a defined union of multiple possible types.
  • Type Inference Engines - Features a type inference engine that deduces variable and union types through conditional logic.
  • Strictness Levels - Offers selectable strictness levels to allow teams to gradually introduce more rigorous type checking.
  • Static Analysis AST Parsing - Uses abstract syntax tree parsing to detect structural errors and programmatic bugs without executing code.
  • CI/CD Integrations - Automating code quality checks and build failures within a continuous integration pipeline for PHP projects.
  • Definition Navigation - Allows developers to jump directly from a symbol's usage to its original source or type definition.
  • On-Demand File Analysis - Provides near-instant feedback by analyzing specific files on demand using a background daemon.
  • Analysis Result Exporters - Outputs analysis findings in multiple formats like JSON and CSV for integration with other quality tools.
  • Interface Stub Files - Uses interface stub files to represent third-party library types without processing their entire source code.
  • Template Type Inference - Determine the concrete type of a template by analyzing function arguments, array elements, or class-string parameters.
  • Incremental Analysis Daemons - Provides a background daemon that maintains codebase state in memory for rapid incremental analysis.
  • Deprecated Feature Markings - Identify functions, methods, or classes that should no longer be used by marking them as deprecated.
  • Language Compatibility Checkers - Checking for backward compatibility issues and ensuring code works across different PHP versions.
  • Language Compatibility Validations - Check for backward compatibility issues across different language versions and ensure inherited method signature compatibility.
  • Analysis Plugin Frameworks - Provides a plugin system to implement custom rules and processors for detecting project-specific bug patterns.
  • Analysis Speed Optimizations - Reduces execution time by distributing workloads across CPU cores and using optimized quick-mode checks.
  • Automated Code Fixes - Automatically resolves a subset of detected issues by applying programmatic byte-range edits to the source.
  • Version Compatibility Analyzers - Check for correct usage of version-specific language features and identify deprecated attributes across different versions.
  • Consistency Verifications - Check that generic classes declare template types and maintain those types when extended by subclasses.
  • Incremental Analysis Engines - Optimizes performance by re-analyzing only modified files and their affected dependencies.
  • Analysis Pipeline Hooks - Allows extending the analysis engine via custom plugins that hook into AST node processing.
  • Static Analysis Extensions - Provides a framework for creating custom rules and plugins to extend static code analysis.
  • Build Gating Tools - A static analysis tool that returns standard exit codes and formatted reports to automate PHP build failures.
  • Static Analysis - Analyzes code for errors using abstract syntax trees.
  • Static Analysis Tools - Modern static analyzer for PHP.
  • Static Analysis - Analyzes PHP codebases to identify potential security and quality issues.

Star history

Star history chart for phan/phanStar history chart for phan/phan

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does phan/phan do?

Phan is a static analyzer and type checker for PHP that identifies bugs and type incompatibilities without executing the code. It serves as a quality gate for continuous integration pipelines and a tool for verifying type safety, specifically checking union types, generics, and array shapes.

What are the main features of phan/phan?

The main features of phan/phan are: Type Safety, PHP Type Checkers, Code Quality and Analysis, IDE Real-time Feedback, Language Server Protocol Implementations, Language Server Protocols, CI/CD Pipeline Integrations, Dead Code Analysis.

Which projects share features with phan/phan?

Projects with overlapping indexed features include: phpstan/phpstan — This project is a static analysis engine and type checker designed for PHP codebases. It evaluates source code… luals/lua-language-server — lua-language-server is a static analysis tool and type checker for the Lua language that implements the Language… larastan/larastan — Larastan is a static analysis extension and type inference engine for PHP designed to detect bugs and type errors in… pycqa/pylint — Pylint is a static code analysis tool for Python that checks source code for errors, coding standard violations, and… dequelabs/axe-core — axe-core is an automated accessibility testing engine and compliance auditor designed to scan web and mobile… terraform-linters/tflint — TFLint is a static analysis tool and infrastructure-as-code validator designed to identify errors and enforce best…

Projects sharing features with Phan

These projects share indexed features with Phan. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • phpstan/phpstanphpstan avatar

    phpstan/phpstan

    13,999View on GitHub↗

    This project is a static analysis engine and type checker designed for PHP codebases. It evaluates source code structure and type annotations to identify potential bugs, type mismatches, and logic errors without executing the application. By parsing code into an abstract syntax tree and applying a rule-based validation framework, it enforces code quality and safety standards across a project. What distinguishes this tool is its sophisticated type inference engine, which models dynamic language features, magic methods, and conditional types to maintain accuracy even in unconventional code. It

    PHPphpphp7phpstan
    View on GitHub↗13,999
  • luals/lua-language-serverLuaLS avatar

    LuaLS/lua-language-server

    4,298View on GitHub↗

    lua-language-server is a static analysis tool and type checker for the Lua language that implements the Language Server Protocol. It provides a system for detecting type mismatches, unused code, and logic errors in source files. The project features an inference-based type system that deduces variable types and supports optional annotations and meta files to enforce type safety. It allows for the definition of custom types and function signatures, including support for overloads and member visibility controls. The server provides a broad set of IDE capabilities, including real-time code auto

    Luahacktoberfestlanguage-serverlpeg
    View on GitHub↗4,298
  • larastan/larastanlarastan avatar

    larastan/larastan

    6,430View on GitHub↗

    Larastan is a static analysis extension and type inference engine for PHP designed to detect bugs and type errors in Laravel applications. It extends PHPStan to resolve framework-specific patterns and magic methods, providing a rule-based scanning engine to audit code quality without executing the application. The tool specializes in Eloquent analysis, verifying that model properties, casts, and relationships align with database schemas and migrations. It tracks types across Eloquent collections, custom builders, and model factories to ensure type safety during database operations and iterati

    PHP
    View on GitHub↗6,430
  • pycqa/pylintPyCQA avatar

    PyCQA/pylint

    5,685View on GitHub↗

    Pylint is a static code analysis tool for Python that checks source code for errors, coding standard violations, and code smells without executing the program. It parses code into an abstract syntax tree and walks the tree to detect issues, enforces configurable style rules and naming conventions, and identifies duplicate code blocks by comparing tokenised source sequences. The tool also includes an inference engine that deduces variable types by simulating code paths, enabling deeper analysis even in untyped code. What distinguishes Pylint is its plugin-based checker architecture, which allo

    Python
    View on GitHub↗5,685
Compare all 30 related projects→