From 818b9ad903223bc744e759d23d8d9b4b88c05493 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 12 Mar 2025 23:11:42 +0100 Subject: [PATCH] Compile: Strip public --- php_shrink.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php_shrink.inc.php b/php_shrink.inc.php index f129a250..f13c2f95 100644 --- a/php_shrink.inc.php +++ b/php_shrink.inc.php @@ -42,7 +42,7 @@ function php_shrink($input) { arsort($short_variables); $chars = implode(range('a', 'z')) . '_' . implode(range('A', 'Z')); - // preserve variable names between versions if possible + //! preserve variable names between versions if possible $short_variables2 = array_splice($short_variables, strlen($chars)); ksort($short_variables); ksort($short_variables2); @@ -75,8 +75,8 @@ function php_shrink($input) { $doc_comment = true; } if ($token[0] == T_VAR || $token[0] == T_PUBLIC || $token[0] == T_PROTECTED || $token[0] == T_PRIVATE) { - if ($token[0] == T_PUBLIC && $tokens[$i+2][1][0] == '$') { - $token[1] = 'var'; + if ($token[0] == T_PUBLIC) { + $token[1] = ($tokens[$i+2][1][0] == '$' ? 'var' : ''); } $shortening = false; } elseif (!$shortening) { -- 2.39.5