需先禁用 VS Code 内置 PHP Language Features,否则功能冲突;非标准 PHP 扩展名需在 files.associations 中手动映射为 php;部分功能为 PREMIUM,需在 intelephense.com 购买并联网激活 licence key
vscode-intelephense
bmewburn更新放缓为 VS Code 提供 PHP 智能补全、跳转定义和错误检查的语言服务器扩展,让 PHP 开发获得接近 IDE 的代码提示体验。
PHP intellisense for Visual Studio Code
在 VS Code 扩展中搜索并安装 Intelephense;随后在扩展面板搜索 @builtin php 并禁用 PHP Language FeaturesREADME 未说明
VS Code 里的高性能 PHP 语言服务器,提供补全、跳转、诊断和格式化
为 VS Code 提供 PHP 智能补全、跳转定义和错误检查的语言服务器扩展,让 PHP 开发获得接近 IDE 的代码提示体验。
核心能力
- 支持驼峰和下划线匹配的代码补全,并自动添加 use 声明
- 提供工作区级跳转到定义、查找所有引用和符号搜索
- 用容错解析器和静态分析引擎生成多类诊断
- 支持 PSR-12 兼容的文档和区间格式化,含 HTML/PHP/JS/CSS 混合文件
- 读取 PHPStorm metadata 增强类型分析与建议
容易踩的坑
- v1.18.51.18.5最新正式版2026-06-21 · 2026-06-21 00:43 UTC
[1.18.5 - 2026-06-21]
Fixed
- Memory leak due to old syntax tree fragments accumulating while editing.
- Intermittent stale diagnostics showing, sometimes referencing bad ranges.
- Template type resolving failing inside a method when the method and class both declare a template type.
- Parameter references not recognised correctly in short anonymous functions.
- By-ref anonymous use variables showing as
nulleven though they have been declared in prior conditional branches. - False method compatibility error when class inherits implementation from a base class but gets abstract declaration from a trait.
- False property compatibility error when interface only declares a get hook and the implementing class defines a more restrictive set visibility.
- TypeError: Cannot read properties of undefined (reading 'toLowerCase') intelephense.js:2:3170612
- Named argument variable highlight bug.
- v1.18.41.18.42026-05-25 · 2026-05-25 21:13 UTC
查看更新说明
[1.18.4 - 2026-05-26]
Fixed
- Conditional types with parameter subject resolving to incorrect type.
- v1.18.31.18.32026-05-17 · 2026-05-17 06:39 UTC
查看更新说明
[1.18.3 - 2026-05-17]
Fixed
- False only variable can be passed by ref error with
extract. - Undefined variable diagnostics not showing within closures in script scope when
intelephense.diagnostics.undefinedVariablesis set tolocal. - Parse error when encountering DNF type after readonly promoted prop modifier.
- Parameter highlight not working in closures.
- If parameter rename text does not start with
$it should be automatically prepended. completion.withMethodBodysetting not working for implement all abstract functions code action.- Incorrect resolution of conditional type when subject type is
mixed. - Go to definition not working for callable arrays when first element is a variable reference.
- Imports not counted as reference in reference code lens.
- Hovering over
@propertyproperty name showing type asunset.
- False only variable can be passed by ref error with
- v1.18.21.18.22026-05-02 · 2026-05-02 04:45 UTC
查看更新说明
[1.18.2 - 2026-05-02]
Fixed
- False array key type error when array is initially empty.
- False duplicate trait in use list when multiple traits in same file use same trait.
- False trait method collision when trait method is identical but inherited by different pathways.
- False unused property error when trait declares property and composing class declares the property as a promoted property.
- Make
instanceofwork withclass-string<T>.
- v1.18.11.18.12026-05-01 · 2026-05-01 05:50 UTC
查看更新说明
[1.18.1 - 2026-05-01]
Changed
- Suppress undefined member diagnostics in traits when scope is
$thisand every type that uses the trait implements the member. - The
intelephense.diagnostics.undefinedVariablessetting has changed from a boolean to an enum of'on'|'local'|'off'. Defaults to'on'. When set to'local'only local scope undefined variables diagnostics will be emitted. BREAKING - The
intelephense.diagnostics.argumentCountsetting has changed from a boolean to an enum of'on'|'declared'|'off'. Defaults to'on'. When set to'declared'only declared functions/method argument count diagnostics will be emitted. That is, annotated@methodmethods will be ignored. BREAKING P1132 No type information availablediagnostics will no longer show for properties with an initialiser or for parameters with a default argument.P1119 Too many argumenterrors will no longer show for functions that callfunc_get_args.
Fixed
- Document symbols broken when using a namespace definition with a body.
#[Override]inserted in wrong spot for method override completion if method modifiers and orfunctionkeyword already present.- False key type errors when using array access notation on
ArrayAccessimplementations. - PHPDoc parse error on
list{a, b}. - Variable type narrowed to never if RHS of
instanceofis a variable of typeclass-string. - False dead code diagnostic when switch case expression is
falseconstant. - Template types not resolving inside methods that inherit template documentation from ancestors in type hierarchy.
- Suppress undefined member diagnostics in traits when scope is
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Intelephense
PHP code intelligence for Visual Studio Code.
Intelephense is a high performance PHP language server packed full of essential features for productive PHP development.
- Fast camel/underscore case code completion (IntelliSense) for document, workspace and built-in symbols and keywords with automatic addition of use declarations.
- Detailed signature (parameter) help for document, workspace and built-in constructors, methods, and functions.
- Rapid workspace wide go to definition support.
- Workspace wide find all references.
- Fast camel/underscore case workspace symbol search.
- Full document symbol search that also powers breadcrumbs and outline UI.
- Multiple diagnostics for open files via an error tolerant parser and powerful static analysis engine.
- Lossless PSR-12 compatible document/range formatting. Formats combined HTML/PHP/JS/CSS files too.
- Embedded HTML/JS/CSS code intelligence.
- Detailed hover with links to official PHP documentation.
- Smart highlight of references and keywords.
- Advanced PHPDoc type system supporting templates and callable signatures.
- Reads PHPStorm metadata for improved type analysis and suggestions.
- Enhances the official xdebug extension with an inline values provider.
- Easy rename of symbols. When appropriate, files/folders are automatically renamed too. PREMIUM
- Accurate code folding of definitions, blocks, use declarations, heredoc, comments, and custom regions. PREMIUM
- Quickly find all implementations of interfaces and abstract classes and associated methods. PREMIUM
- Fast go to type definition of typed variables and parameters. PREMIUM
- Fast go to declaration for methods implementing an interface or abstract method declaration. PREMIUM
- Configurable auto PHPDoc creation that infers return types and identifies thrown exceptions. PREMIUM
- Syntax tree driven smart select to intelligently expand/shrink selection. PREMIUM
- Helpful code actions to import symbols, add PHPDoc, and implement all abstract methods. PREMIUM
- Concise type hierarchy. Easily view and navigate to subtypes and supertypes. PREMIUM
- Insightful code lens that shows references, abstract and interface implementations, trait usages, method parent and overrides. PREMIUM
- Informative inlay hints to indicate parameter names, return types and anonymous function parameter types. PREMIUM
- Convenient document links to quickly navigate to include/require files. PREMIUM
@mixinsupport. PREMIUM
Licence
Purchase a licence at https://intelephense.com to access PREMIUM features. Licence keys grant a single user access to all current and future premium features on multiple devices forever. Licence keys must be activated (automatically) via https before use. Features not marked as PREMIUM are free and always will be free.
The language server client (vscode-intelephense) is open source and licensed under the MIT licence.
The language server (intelephense) is proprietary. Please see here for details.
Quick Start
-
Disable the built-in VSCode PHP Language Features.
- Go to
Extensions. - Search for
@builtin php - Disable
PHP Language Features. LeavePHP Language Basicsenabled for syntax highlighting.
Note that other (3rd party) PHP extensions which provide similar functionality should also be disabled for best results.
- Go to
-
Add glob patterns for non standard php file extensions to the
files.associationssetting.For example:
"files.associations": { "*.module": "php" }. -
Optionally purchase and enter your licence key by opening the command pallete --
ctrl + shift + p-- and searching forEnter licence key.
Further configuration options are available in the intelephense section of settings.
Support
Try the Intelephense Documentation.
Found a bug? Got a feature request? Create an issue.
Acknowledgements
A big thank you to supporters who have bought a premium licence and have enabled the continued development and maintenance of this extension.
Intelephense uses the following open source libraries. Please see the following links for source code and licences.