vrana / phpshrink
Remove spaces and comments from PHP code.
Installs: 95
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/vrana/phpshrink
Requires
- php: >=5.3
This package is auto-updated.
Last update: 2025-10-18 21:28:04 UTC
README
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$GLOBALSand named arguments) - remove extra
{}, e.g. inif (true) { oneCommand(); } - remove
?><?phpand empty<?php ?> - change
?>HTML<?phptoecho 'HTML' - join consecutive echo, e.g. in
echo 'a'; echo 'b'; - strip public visibility or change it to
var
Demo: https://vrana.github.io/PhpShrink/
The main user is Adminer.