vrana / phpshrink
Remove spaces and comments from PHP code.
dev-main
2025-05-07 06:59 UTC
Requires
- php: >=5.3
This package is auto-updated.
Last update: 2025-08-18 21:11:30 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.