Side by side
clang-format vs PHP CS Fixer
Both stand on code formatters. Which one you can start free with, which one lets you read the code, and what each costs once you pay.
Free plan ExtensionLinuxMac+1
clang-format offers broad language coverage and several ways to apply formatting, from editors to staged Git changes. Its single-file limit for range formatting is the main restriction to account for in automated workflows.
Visit clang-format Free plan LinuxSelf-hosted
PHP CS Fixer offers automatic formatting alongside a reporting-only mode, with configurable styles and editor and CI options. Its MIT license and free price make it available without a listed purchase cost.
Visit PHP CS FixerThe facts
| clang-format | PHP CS Fixer | |
|---|---|---|
| Free plan | Yes | Yes |
| Open source | Not published | Not published |
| Runs on | Extension, Linux, Mac, Windows | Linux, Self-hosted |
| Lowest paid plan | Not published | Free or on request |
| Plans published | None | 1 |
| Maker | Not published | Not published |
| Website | clang.llvm.org | cs.symfony.com |
| On code formatters | #5 of 22 | #9 of 22 |
clang-format: what it does well
- Free and open source
- Supports many source-code languages
- Includes multiple built-in style presets
- Formats changed Git lines
- Provides editor integrations
What to know first
- Range formatting accepts only one input file
- Style rules require configuration for custom conventions
PHP CS Fixer: what it does well
- Built-in rule sets cover PER, Symfony, and PhpCsFixer styles
- Custom styles and rules are supported
- `check` reports without changing files
- Risky rules are off by default
- Editor plugins and CI examples are documented
What to know first
- Supports PHP only
- No free trial
- Risky rules are not run by default
Alternatives to clang-format Alternatives to PHP CS Fixer The whole list