PHPackages                             vrana/phpshrink - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vrana/phpshrink

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vrana/phpshrink
===============

Remove spaces and comments from PHP code.

3417—7.1%3PHP

Since Apr 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vrana/PhpShrink)[ Packagist](https://packagist.org/packages/vrana/phpshrink)[ RSS](/packages/vrana-phpshrink/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (3)

PhpShrink
=========

[](#phpshrink)

Remove spaces and comments from PHP code.

Operations:

- remove unnecessary whitespace, change necessary whitespace to `\n`
- strip comments, preserve only the first doc-comment
- minify variables, e.g. in `function f($long) { return $long; }` (incompatible with `$GLOBALS` and named arguments)
- remove extra `{}`, e.g. in `if (true) { oneCommand(); }`
- remove `?>`
- change `?>HTML
