PHP Formatter

PHP Formatter beautifies PHP code with consistent indentation, line wrapping, braces, operators, arrays, function calls, classes, attributes, match expressions, and comments. Paste a complete PHP file or a temporary PHP snippet; snippets without an opening <?php tag are handled automatically.

Choose the minimum PHP version, tabs or spaces, line width, brace style, trailing commas, and quote style. Syntax errors are shown in the output editor without replacing or uploading the original source.

Formatting uses a locally hosted browser build of the Prettier PHP parser. It is intended for pure PHP files and snippets; mixed PHP and HTML templates can contain framework-specific constructs that require a project-aware formatter.