Paste PHP and press the button: the formatting runs in this browser, nothing is sent anywhere, and no PHP is executed.
Runs locally in your browserPaste a snippet or a complete file and press PHP Code Formatting. Indentation is rewritten with one tab per level inside the browser; the code is never executed, no output is produced and no part of it is uploaded.
The result keeps the passages that are literal output rather than code: the body of a heredoc or nowdoc, a # or // comment, and the HTML between a closing ?> and the next opening tag. Those regions come back byte for byte, which is what a template needs, because a stray re-indent there changes the rendered page.
Every statement that was written on one line is split at its semicolon, braces move onto their own lines, and each level of nesting gets one more tab. That turns a minified class into something readable, and it also means the output no longer matches the input line by line: blank lines are removed, tabs are always used for indentation, and a long array or argument list is left on a single line instead of being rewrapped. A project that uses four spaces needs a pass with its own formatter after the paste.
A heredoc or nowdoc body is literal output, so it is copied byte for byte, including the indented closing marker allowed since PHP 7.3. Line comments starting with # or // are treated as comments and not as braces, which matters for a block such as # see the {placeholder} syntax, and a PHP 8 attribute such as #[Route('/x')] is still treated as code because an attribute does not open a comment. Text between ?> and the next <?php belongs to HTML and is never re-indented, so a template loop such as foreach (...): with an inner <?= ... ?> comes back with its markup intact.
The tabifier reads characters, not a parse tree: it never runs the code, never checks syntax, and an unfinished brace or a missing quote comes back as written instead of as an error message. The colouring runs after the layout, and past roughly 120 KB it is skipped so that the page stays responsive, which leaves a large file readable but plain. For anything beyond a quick cleanup, php-cs-fixer, PHP_CodeSniffer or the formatter built into an editor will preserve the styles and the blank lines of a real project, and they can be run on the whole tree rather than on one paste.