phpfmt - PHP formatter installs statistics
By kokororin · VS Code Marketplace · Linters
Integrates phpfmt into VS Code
phpfmt - PHP formatter has 1,198,960 recorded installs on VS Code Marketplace, ranking #488 of 2,501 tracked listings.
Rating: 4.44 / 5 from 75 ratings
About phpfmt - PHP formatter
phpfmt for Visual Studio Code
The missing phpfmt extension for Visual Studio Code.
Installation
Open command palette F1 and select Extensions: Install Extension, then search for phpfmt.
Note: PHP 5.6 or newer is required in the machine to run this plugin.
Usage
F1 -> phpfmt: Format This File
or keyboard shortcut Ctrl + Shift + I which is Visual Studio Code default formatter shortcut
or right mouse context menu Format Document or Format Selection
Format On Save
Respects editor.formatOnSave setting.
You can turn off format-on-save on a per-language basis by scoping the setting:
// Set the default
"editor.formatOnSave": false,
// Enable per-language
"[php]": {
"editor.formatOnSave": true
}
Q&A
Q: How to use phpfmt.php_bin with spaces such as C:\Program Files\php\php.exe ?
A: Wrap your path with quotes like:
{
"phpfmt.php_bin": "\"C:\\Program Files\\php\\php.exe\""
}
It is recommended to add the directory of the php.exe to the PATH environment variable on Windows.
If it still not working, refer to #1 and Stack Overflow Related.
Q: How use tabs instead of spaces with PSR2 enabled ?
A: For PSR2, code MUST use 4 spaces for indenting, not tabs. But if you like PSR2, and do not like 4 spaces for indentation, add following configuration:
{
"phpfmt.passes": [
"PSR2KeywordsLowerCase",
"PSR2LnAfterNamespace",
"PSR2CurlyOpenNextLine",
"PSR2ModifierVisibilityStaticOrder",
"PSR2SingleEmptyLineAndStripClosingTag",
"ReindentSwitchBlocks"
],
"phpfmt.exclude": [
"ReindentComments",
"StripNewlineWithinClassBody"
],
"phpfmt.psr2": false
}
Q: Is fmt.phar (phpfmt itself) still maintained ?
A: Since phpfmt has no maintainers, only Serious bugs will be fixed.
A: We now use fmt.stub.php from driade's phpfmt8 which is very updated.
Configuration
<!-- Configuration START -->| Key | Type | Description | Default |
|---|---|---|---|
| phpfmt.php_bin | string | php executable path | "php" |
| phpfmt.use_old_phpfmt | boolean | use old fmt.phar which supports 5.6 | false |
| phpfmt.detect_indent | boolean | auto detecting indent type and size (will ignore indent_with_space) | false |
| phpfmt.psr1 | boolean | activate PSR1 style | false |
| phpfmt.psr1_naming | boolean | activate PSR1 style - Section 3 and 4.3 - Class and method names case. | false |
| phpfmt.psr2 | boolean | activate PSR2 style | true |
| phpfmt.wp | boolean | activate WP style | false |
| phpfmt.indent_with_space | integer | boolean | use spaces instead of tabs for indentation. Default 4 | 4 |
| phpfmt.enable_auto_align | boolean | enable auto align of ST_EQUAL and T_DOUBLE_ARROW | false |
| phpfmt.visibility_order | boolean | fixes visibiliy order for method in classes - PSR-2 4.2 | false |
| phpfmt.ignore | array | ignore file names whose names contain any pattern that could be matched with .match JS string method | [] |
| phpfmt.passes | array | call specific compiler pass | ["AlignDoubleArrow","AlignPHPCode","SpaceAfterExclamationMark","AlignConstVisibilityEquals","AutoSemicolon","ConvertOpenTagWithEcho","AlignEquals","MergeNamespaceWithOpenTag","RemoveSemicolonAfterCurly","RestoreComments","ShortArray","ExtraCommaInArray","AlignDoubleSlashComments","IndentTernaryConditions","IndentPipeOperator","AlignSuperEquals"] |
| phpfmt.exclude | array | disable specific passes | [] |
| phpfmt.smart_linebreak_after_curly | boolean | convert multistatement blocks into multiline blocks | false |
| phpfmt.yoda | boolean | yoda-style comparisons | false |
| phpfmt.cakephp | boolean | Apply CakePHP coding style | false |
| phpfmt.custom_arguments | string | provide custom arguments to overwrite default arguments generated by config | "" |
Supported Transformations
F1 -> phpfmt: List Transformations to get the example of each
transformation.…
Description from the VS Code Marketplace listing.
- php
- phpfmt
- vscode
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Ratings over time
Listing placement
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Installs on a linear scale. Placement is projected from installs, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (5)Similar VS Code Marketplace Linters plugins
All 20 phpfmt - PHP formatter alternativesData source
Install counts, average rating, and rating counts come from the public Visual Studio Marketplace gallery API. Installs are cumulative and exclude updates.
Listing: https://marketplace.visualstudio.com/items?itemName=kokororin.vscode-phpfmt. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.