Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>PHPDoc CommentNew to Visual Studio Code? Get it now.
PHPDoc Comment

PHPDoc Comment

Rex Shi

|
307,506 installs
| (9) | Free
Generate PHPDoc blocks for modern PHP functions, properties, classes, interfaces, traits, and enums.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PHPDoc Comment

Visual Studio Marketplace CI

This extension adds PHPDoc blocks for PHP functions, properties, classes, interfaces, traits, and enums in VS Code.

Using

In a PHP file, place your cursor on the first line of a declaration, then run Add PHPDoc Comment from the Command Palette (F1). You can also use Cmd+Shift+I on macOS, Ctrl+Shift+I on Windows/Linux, or the editor context menu.

The extension supports multiline function signatures, class and namespaced types, nullable types, union and intersection types, promoted constructor properties, variadic/reference parameters, typed properties, and nested default values.

If a declaration already has a PHPDoc block, the command leaves it unchanged. PHP attributes remain attached to their declarations because generated documentation is inserted before the attribute block.

preview

Limitations

Parameter types are not inferred from usage. Parameters and properties without a declared or recognizable default type are documented as mixed.

Enjoy!

Development

npm ci
npm run check
npm run lint
npm test
npm run test:integration
npm run package
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft