[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8329":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":17,"lastSyncTime":32,"discoverSource":33},8329,"phan","phan\u002Fphan","Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.","https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki",null,"PHP",5616,369,96,787,0,1,2,64.4,"Other",false,"v6",true,[24,25,5,26,27,28],"analysis","analyzer","php","static-analysis","static-code-analysis","2026-06-12 04:00:38","Phan is a static analyzer for PHP that prefers to minimize false-positives. Phan attempts to prove incorrectness rather than correctness.\n\nPhan looks for common issues and will verify type compatibility on various operations when type\ninformation is available or can be deduced. Phan has a good (but not comprehensive) understanding of flow control\nand can track values in a few use cases (e.g. arrays, integers, and strings).\n\n[![Build Status](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Factions\u002Fworkflows\u002Fmain.yml\u002Fbadge.svg?branch=v6)](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Factions\u002Fworkflows\u002Fmain.yml?query=branch%3Av6)\n[![Build Status (Windows)](https:\u002F\u002Fci.appveyor.com\u002Fapi\u002Fprojects\u002Fstatus\u002Fgithub\u002Fphan\u002Fphan?branch=v6&svg=true)](https:\u002F\u002Fci.appveyor.com\u002Fproject\u002FTysonAndre\u002Fphan\u002Fbranch\u002Fv6)\n[![Gitter](https:\u002F\u002Fbadges.gitter.im\u002Fphan\u002Fphan.svg)](https:\u002F\u002Fgitter.im\u002Fphan\u002Fphan?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n[![Latest Stable Version](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fv\u002Fphan\u002Fphan.svg)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fphan\u002Fphan)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fl\u002Fphan\u002Fphan.svg)](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fblob\u002Fv6\u002FLICENSE)\n\n# Getting Started\n\nThe easiest way to use Phan is via Composer.\n\n```\ncomposer require phan\u002Fphan\n```\n\nWith Phan installed, you can start analyzing your code immediately! Phan includes built-in stubs for enhanced type checking of PHP extensions.\n\nFor new projects, use `phan --init` to create a `.phan\u002Fconfig.php` file with recommended settings and bundled stubs. You can also [manually create a config file](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FGetting-Started#creating-a-config-file) if you prefer. Once configured, you can run it via `.\u002Fvendor\u002Fbin\u002Fphan`.\n\nPhan 6 requires PHP 8.1+ with the [php-ast](https:\u002F\u002Fgithub.com\u002Fnikic\u002Fphp-ast) extension (1.1.3+ is required for PHP 8.4+ support) and supports analyzing PHP version 8.1-8.5 syntax.\nInstallation instructions for php-ast can be found [here](https:\u002F\u002Fgithub.com\u002Fnikic\u002Fphp-ast#installation).\n(Phan can be used without php-ast by using the CLI option `--allow-polyfill-parser`, but there are slight differences in the parsing of doc comments)\n\n* **Alternative Installation Methods**\u003Cbr \u002F>\n  See [Getting Started](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FGetting-Started) for alternative methods of using\nPhan and details on how to configure Phan for your project.\u003Cbr \u002F>\n* **Incrementally Strengthening Analysis**\u003Cbr \u002F>\n  Take a look at [Incrementally Strengthening Analysis](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FIncrementally-Strengthening-Analysis) for some tips on how to slowly ramp up the strictness of the analysis as your code becomes better equipped to be analyzed. \u003Cbr \u002F>\n* **Installing Dependencies**\u003Cbr \u002F>\n  Take a look at [Installing Phan Dependencies](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FGetting-Started#installing-phan-dependencies) for help getting Phan's dependencies installed on your system.\n\nThe [Wiki has more information about using Phan](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki#using-phan).\n\n# Tolerant parser dependency\n\nPhan relies on [`phan\u002Fphan-tolerant`](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan-tolerant) for the fallback parser and language-server mapping. The project is now consumed as a Composer dependency (`microsoft\u002Ftolerant-php-parser`, overridden to our fork via the repository entry in `composer.json`) rather than via a vendored subtree.\n\nTo run the tolerant parser’s own PHPUnit suites, install its dev dependencies and invoke PHPUnit from the dependency directory:\n\n```\ncomposer install\ncd vendor\u002Fmicrosoft\u002Ftolerant-php-parser\ncomposer install\nphp -d zend.assertions=1 -d assert.exception=1 vendor\u002Fbin\u002Fphpunit --testsuite invariants,api\n```\n\nWhen you need to refresh the parser to a newer commit, adjust the constraint in `composer.json` (or run `composer update microsoft\u002Ftolerant-php-parser`) and commit the resulting lockfile change.\n\n# Features\n\nPhan is able to perform the following kinds of analysis:\n\n* Check that all methods, functions, classes, traits, interfaces, constants, properties and variables are defined and accessible.\n* Check for type safety and arity issues on method\u002Ffunction\u002Fclosure calls.\n* Check for PHP 8.5\u002F8.4\u002F8.3\u002F8.2\u002F8.1 backward compatibility.\n* Check for features that weren't supported in older PHP 8.x minor releases (E.g. property hooks, `readonly` classes, enums, union types, match expressions, etc.)\n* Check for sanity with array accesses.\n* Check for type safety on binary operations.\n* Check for valid and type safe return values on methods, functions, and closures.\n* Check for No-Ops on arrays, closures, constants, properties, variables, unary operators, and binary operators.\n* Check for unused\u002Fdead\u002F[unreachable](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#unreachablecodepluginphp) code. (Pass in `--dead-code-detection`)\n* Check for unused variables and parameters. (Pass in `--unused-variable-detection`)\n* Check for redundant or impossible conditions and pointless casts. (Pass in `--redundant-condition-detection`)\n* Check for unused `use` statements.\n  These and a few other issue types can be automatically fixed with `--automatic-fix`.\n* Check for classes, functions and methods being redefined.\n* Check for sanity with class inheritance (e.g. checks method signature compatibility).\n  Phan also checks for final classes\u002Fmethods being overridden, that abstract methods are implemented, and that the implemented interface is really an interface (and so on).\n* Supports namespaces, traits and variadics.\n* Supports [Union Types](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAbout-Union-Types).\n* Supports [Generic Types (i.e. `@template`)](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FGeneric-Types).\n* Supports generic arrays such as `int[]`, `UserObject[]`, `array\u003Cint,UserObject>`, etc..\n* Supports array shapes such as `array{key:string,otherKey:?stdClass}`, etc. (internally and in PHPDoc tags)\n  This also supports indicating that fields of an array shape are optional\n  via `array{requiredKey:string,optionalKey?:string}` (useful for `@param`).\n  Multi-line forms of `@param`, `@var`, and `@return` annotations are normalized before being parsed, so docblocks can format nested arrays\u002Fgenerics over several lines.\n* Supports phpdoc [type annotations](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAnnotating-Your-Source-Code).\n* Supports inheriting phpdoc type annotations.\n* Supports checking that phpdoc type annotations are a narrowed form (E.g. subclasses\u002Fsubtypes) of the real type signatures\n* Supports inferring types from [assert() statements](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAnnotating-Your-Source-Code) and conditionals in if elements\u002Floops.\n* Supports [`@deprecated` annotation](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAnnotating-Your-Source-Code#deprecated) for deprecating classes, methods and functions\n* Supports [`@internal` annotation](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAnnotating-Your-Source-Code#internal) for elements (such as a constant, function, class, class constant, property or method) as internal to the package in which it's defined.\n* Supports `@suppress \u003CISSUE_TYPE>` annotations for [suppressing issues](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAnnotating-Your-Source-Code#suppress).\n* Supports [magic @property annotations](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAnnotating-Your-Source-Code#property) (`@property \u003Cunion_type> \u003Cvariable_name>`)\n* Supports [magic @method annotations](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAnnotating-Your-Source-Code#method) (`@method \u003Cunion_type> \u003Cmethod_name>(\u003Cunion_type> \u003Cparam1_name>)`)\n* Supports [`class_alias` annotations (experimental, off by default)](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fpull\u002F586)\n* Supports indicating the class to which a closure will be bound, via `@phan-closure-scope` ([example](tests\u002Ffiles\u002Fsrc\u002F0264_closure_override_context.php))\n* Supports analysis of closures and return types passed to `array_map`, `array_filter`, and other internal array functions.\n* Offers extensive configuration for weakening the analysis to make it useful on large sloppy code bases\n* Can be run on many cores. (requires `pcntl`)\n* Output is emitted in text, checkstyle, json, pylint, csv, codeclimate, html, or github formats.\n* Can run [user plugins on source for checks specific to your code](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FWriting-Plugins-for-Phan).\n  [Phan includes various plugins you may wish to enable for your project](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#2-general-use-plugins).\n\nSee [Phan Issue Types](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FIssue-Types-Caught-by-Phan) for descriptions\nand examples of all issues that can be detected by Phan. Take a look at the\n[\\Phan\\Issue](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fblob\u002Fv6\u002Fsrc\u002FPhan\u002FIssue.php) to see the\ndefinition of each error type.\n\nTake a look at the [Tutorial for Analyzing a Large Sloppy Code Base](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FTutorial-for-Analyzing-a-Large-Sloppy-Code-Base) to get a sense of what the process of doing ongoing analysis might look like for you.\n\nPhan can be used from [various editors and IDEs](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FEditor-Support) for its error checking, \"go to definition\" support, etc. via the [Language Server Protocol](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002Flanguage-server-protocol).\nEditors and tools can also request analysis of individual files in a project using the simpler [Daemon Mode](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FUsing-Phan-Daemon-Mode).\n\nSee the [tests](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fblob\u002Fv6\u002Ftests\u002Ffiles) directory for some examples of the various checks.\n\nPhan is imperfect and shouldn't be used to prove that your PHP-based rocket guidance system is free of defects.\n\n## Features provided by plugins\n\nAdditional analysis features have been provided by [plugins](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#plugins).\n\n- [Checking for syntactically unreachable statements](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#unreachablecodepluginphp) (E.g. `{ throw new Exception(\"Message\"); return $value; }`)\n- [Checking `*printf()` format strings against the provided arguments](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#printfcheckerplugin) (as well as checking for common errors)\n- [Checking that PCRE regexes passed to `preg_*()` are valid](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#pregregexcheckerplugin)\n- [Checking for `@suppress` annotations that are no longer needed.](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#unusedsuppressionpluginphp)\n- [Checking for duplicate or missing array keys.](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#duplicatearraykeypluginphp)\n- [Checking coding style conventions](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#3-plugins-specific-to-code-styles)\n- [Others](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins#plugins)\n\nExample: [Phan's plugins for self-analysis.](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fblob\u002F3.2.8\u002F.phan\u002Fconfig.php#L601-L674)\n\n# Usage\n\nAfter [installing Phan](#getting-started), Phan needs to be configured with details on where to find code to analyze and how to analyze it. The\neasiest way to tell Phan where to find source code is to [create a `.phan\u002Fconfig.php` file](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FGetting-Started#creating-a-config-file).\nA simple `.phan\u002Fconfig.php` file might look something like the following.\n\n```php\n\u003C?php\n\n\u002F**\n * This configuration will be read and overlaid on top of the\n * default configuration. Command line arguments will be applied\n * after this file is read.\n *\u002F\nreturn [\n\n    \u002F\u002F Supported values: `'8.1'`, `'8.2'`, `'8.3'`, `'8.4'`, `'8.5'`, `null`.\n    \u002F\u002F If this is set to `null`,\n    \u002F\u002F then Phan assumes the PHP version which is closest to the minor version\n    \u002F\u002F of the php executable used to execute Phan.\n    \"target_php_version\" => null,\n\n    \u002F\u002F A list of directories that should be parsed for class and\n    \u002F\u002F method information. After excluding the directories\n    \u002F\u002F defined in exclude_analysis_directory_list, the remaining\n    \u002F\u002F files will be statically analyzed for errors.\n    \u002F\u002F\n    \u002F\u002F Thus, both first-party and third-party code being used by\n    \u002F\u002F your application should be included in this list.\n    'directory_list' => [\n        'src',\n        'vendor\u002Fsymfony\u002Fconsole',\n    ],\n\n    \u002F\u002F A directory list that defines files that will be excluded\n    \u002F\u002F from static analysis, but whose class and method\n    \u002F\u002F information should be included.\n    \u002F\u002F\n    \u002F\u002F Generally, you'll want to include the directories for\n    \u002F\u002F third-party code (such as \"vendor\u002F\") in this list.\n    \u002F\u002F\n    \u002F\u002F n.b.: If you'd like to parse but not analyze 3rd\n    \u002F\u002F       party code, directories containing that code\n    \u002F\u002F       should be added to the `directory_list` as\n    \u002F\u002F       to `exclude_analysis_directory_list`.\n    \"exclude_analysis_directory_list\" => [\n        'vendor\u002F'\n    ],\n\n    \u002F\u002F A list of plugin files to execute.\n    \u002F\u002F Plugins which are bundled with Phan can be added here by providing their name\n    \u002F\u002F (e.g. 'AlwaysReturnPlugin')\n    \u002F\u002F\n    \u002F\u002F Documentation about available bundled plugins can be found\n    \u002F\u002F at https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Ftree\u002Fv6\u002F.phan\u002Fplugins\n    \u002F\u002F\n    \u002F\u002F Alternately, you can pass in the full path to a PHP file\n    \u002F\u002F with the plugin's implementation.\n    \u002F\u002F (e.g. 'vendor\u002Fphan\u002Fphan\u002F.phan\u002Fplugins\u002FAlwaysReturnPlugin.php')\n    'plugins' => [\n        \u002F\u002F checks if a function, closure or method unconditionally returns.\n        \u002F\u002F can also be written as 'vendor\u002Fphan\u002Fphan\u002F.phan\u002Fplugins\u002FAlwaysReturnPlugin.php'\n        'AlwaysReturnPlugin',\n        'DollarDollarPlugin',\n        'DuplicateArrayKeyPlugin',\n        'DuplicateExpressionPlugin',\n        'PregRegexCheckerPlugin',\n        'PrintfCheckerPlugin',\n        'SleepCheckerPlugin',\n        \u002F\u002F Checks for syntactically unreachable statements in\n        \u002F\u002F the global scope or function bodies.\n        'UnreachableCodePlugin',\n        'UseReturnValuePlugin',\n        'EmptyStatementListPlugin',\n        'LoopVariableReusePlugin',\n    ],\n];\n```\n\nTake a look at [Creating a Config File](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FGetting-Started#creating-a-config-file) and\n[Incrementally Strengthening Analysis](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FIncrementally-Strengthening-Analysis) for\nmore details.\n\nRunning `phan --help` will show [usage information and command-line options](.\u002Finternal\u002FCLI-HELP.md).\n\n## Annotating Your Source Code\n\nPhan reads and understands most [PHPDoc](http:\u002F\u002Fwww.phpdoc.org\u002Fdocs\u002Flatest\u002Fguides\u002Ftypes.html)\ntype annotations including [Union Types](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAbout-Union-Types)\n(like `int|MyClass|string|null`) and generic array types (like `int[]` or `string[]|MyClass[]` or `array\u003Cint,MyClass>`).\n\nTake a look at [Annotating Your Source Code](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAnnotating-Your-Source-Code)\nand [About Union Types](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FAbout-Union-Types) for some help\ngetting started with defining types in your code.\n\nPhan supports `(int|string)[]` style annotations, and represents them internally as `int[]|string[]`\n(Both annotations are treated like array which may have integers and\u002For strings).\nWhen you have arrays of mixed types, just use `array`.\n\nThe following code shows off the various annotations that are supported.\n\n```php\n\u002F**\n * @return void\n *\u002F\nfunction f() {}\n\n\u002F** @deprecated *\u002F\nclass C {\n    \u002F** @var int *\u002F\n    const C = 42;\n\n    \u002F** @var string[]|null *\u002F\n    public $p = null;\n\n    \u002F**\n     * @param int|null $p\n     * @return string[]|null\n     *\u002F\n    public static function f($p) {\n        if (is_null($p)) {\n            return null;\n        }\n\n        return array_map(\n            \u002F** @param int $i *\u002F\n            function($i) {\n                return \"thing $i\";\n            },\n            range(0, $p)\n        );\n    }\n}\n```\n\nJust like in PHP, any type can be nulled in the function declaration which also\nmeans a null is allowed to be passed in for that parameter.\n\nPhan checks the type of every single element of arrays (Including keys and values).\nIn practical terms, this means that `[$int1=>$int2,$int3=>$int4,$int5=>$str6]` is seen as `array\u003Cint,int|string>`,\nwhich Phan represents as `array\u003Cint,int>|array\u003Cint,string>`.\n`[$strKey => new MyClass(), $strKey2 => $unknown]` will be represented as\n`array\u003Cstring,MyClass>|array\u003Cstring,mixed>`.\n\n- Literals such as `[12,'myString']` will be represented internally as array shapes such as `array{0:12,1:'myString'}`\n\n# Generating a file list\n\nThis static analyzer does not track includes or try to figure out autoloader magic. It treats\nall the files you throw at it as one big application. For code encapsulated in classes this\nworks well. For code running in the global scope it gets a bit tricky because order\nmatters. If you have an `index.php` including a file that sets a bunch of global variables and\nyou then try to access those after the `include(...)` in `index.php` the static analyzer won't\nknow anything about these.\n\nIn practical terms this simply means that you should put your entry points and any files\nsetting things in the global scope at the top of your file list. If you have a `config.php`\nthat sets global variables that everything else needs, then you should put that first in the list followed by your\nvarious entry points, then all your library files containing your classes.\n\n# Development\n\nTake a look at [Developer's Guide to Phan](https:\u002F\u002Fgithub.com\u002Fphan\u002Fphan\u002Fwiki\u002FDeveloper's-Guide-To-Phan) for help getting started hacking on Phan.\n\nWhen you find an issue, please take the time to create a tiny reproducing code snippet that illustrates\nthe bug. And once you have done that, fix it. Then turn your code snippet into a test and add it to\n[tests](tests) then `.\u002Ftest` and send a PR with your fix and test. Alternatively, you can open an Issue with\ndetails.\n\nTo run Phan's unit tests, just run `.\u002Ftest`.\n\nTo run all of Phan's unit tests and integration tests, run `.\u002Ftests\u002Frun_all_tests.sh`\n\n# Code of Conduct\n\nWe are committed to fostering a welcoming community. Any participant and\ncontributor is required to adhere to our [Code of Conduct](.\u002FCODE_OF_CONDUCT.md).\n\n# Online Demo\n\n**This requires an up to date version of Firefox\u002FChrome and at least 4 GB of free RAM.** (this is a 15 MB download)\n\n[Run Phan entirely in your browser](https:\u002F\u002Fphan.github.io\u002Fdemo\u002F).\n\n[![Preview of analyzing PHP](https:\u002F\u002Fraw.githubusercontent.com\u002Fphan\u002Fdemo\u002Fmaster\u002Fstatic\u002Fpreview.png)](https:\u002F\u002Fphan.github.io\u002Fdemo\u002F)\n","Phan 是一个 PHP 静态分析工具，旨在减少误报并通过证明代码的不正确性来提高代码质量。其核心功能包括检测常见的编程错误、验证类型兼容性以及在某些情况下跟踪变量值的变化。Phan 对流程控制有较好的理解，并能处理数组、整数和字符串等数据类型的静态分析。适用于需要提升代码质量和减少潜在错误的 PHP 项目开发场景中，尤其适合那些希望逐步增强代码静态分析严格度的团队。通过 Composer 可以轻松安装并集成到现有项目中。","2026-06-11 03:17:24","top_language"]