Code Completion#
The PHP editor analyses the entire workspace, it determines expressions type, function return type, property type, and local variables type. The inferred type information can be improved by providing further details using PHPDoc comments (see below).

Code completion is context-aware, scope-aware, type-aware, with the respect to conventions and additional heuristics.
Supported Notations#
The majority of the following notations are supported:
- PHPDoc type annotations.
- PHPDoc generic type annotations.
- Majority of PhpStan annotations in PHPDoc, templates, type aliases, generics, conditional return, type substitutions, and more.
phpstan.neon,phpstan.neon.dist,phpstan.dist.neonfiles withtypeAliasessection.- Majority of Psalm type annotations in PHPDoc.
phpcscomments for disabling and enabling errors, i.e.// phpcs:disableand// phpcs:ignorefile@mixinPHPDoc annotation.- JetBrains's PhpStorm
.phpstorm.meta.phpfile with additional annotations.- limitations: #2265 - file is analyzed statically so variables and dynamic values are ignored.
- Symfony and Laravel features (IntelliSense):
- deducing defined class aliases
- deducing provided services and facades
- Eloquent local scopes and extension methods
Completing Parentheses#
By default, completing a function name also completes parentheses and, if the function has any parameters to fill in, the keyboard cursor is placed inside them.
This behavior is controlled by the setting:
Alternativelly, the editor may complete default values for all the parameters. Set the setting to "parameters" to do so:

Automatic Triggers#
The completion can be triggered manually (Ctrl+Space by default) or automatically. The automatic triggers are:
- a letter completes available symbols in the current context
::after a class/interface/trait name completes the type static members and constants.->after an object instance completes the object's non-static members.\as a part of a qualified name completes the namespaced (qualified) type name.$as a first letter shows variables in the current function scope.- a letter or
Ctrl+Spaceafternewkeyword completes possible class names - a letter or
Ctrl+Spaceafterthrow newcompletes only throwable classes - a letter or
Ctrl+Spaceafterusekeyword. -
` var $property;
function foo() { $x = eval('magic1()');
$x->query(); return eval('magic2()');} } ```
Limitations#
The code editor may not resolve class_alias() without constant expressions; therefore some aliased class names may not be included in the code completion.
The code editor won't recognize files containing a syntax error.
The code editor may not provide precise completions after eval() expression or after classes being instantiated indirectly (using an expression new $classname instead of a constant qualified name).