Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>PHP Operator AssistNew to Visual Studio Code? Get it now.
PHP Operator Assist

PHP Operator Assist

Abdul Jalil Stanikzai

|
3 installs
| (1) | Free
Use a dot for PHP object and static access operators: -> and ::.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PHP Operator Assist

Use . as a typing shortcut for PHP object and static access operators. PHP Operator Assist converts the dot based on the expression before it:

Type Becomes
$user. $user->
$user->profile. $user->profile->
Route. Route::
App\Models\User. App\Models\User::
self. / static. / parent. self:: / static:: / parent::

It works in PHP files and Laravel Blade files.

String concatenation

By default, conversion only happens when the dot is directly next to the expression. This leaves the usual spaced concatenation syntax unchanged:

$message = $first . $second;

Dots inside strings and comments are ignored. Class detection uses PHP naming conventions: a class-like name whose final segment starts with an uppercase letter, and the keywords self, static, and parent, become ::. Lowercase class aliases are left unchanged because they are ambiguous with function names.

Settings

  • phpDotToArrow.enabled: turn conversion on or off (default true).
  • phpDotToArrow.onlyWithoutWhitespace: convert only when the dot directly follows the expression (default true). Turning this off can also convert spaced string concatenation.

Install from a VSIX

In VS Code, open Extensions, select … → Install from VSIX…, and choose the generated php-operator-assist-<version>.vsix file.

Develop and test

  1. Open this repository in VS Code.
  2. Press F5 to launch the Extension Development Host.
  3. Type a dot after an object variable or class name in a PHP or Blade file.
  4. Run npm test to run the conversion tests.

To package the extension locally, install the VS Code Extension Manager and run:

npm install -g @vscode/vsce
vsce package

License

MIT. See LICENSE.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft