From 5504a617d0fd932f028ee40a053d8e8cc4c894b1 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 12 Mar 2025 05:03:42 +0100 Subject: [PATCH] Compile: Support private static --- compile.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compile.php b/compile.php index fda698df..b56c676f 100755 --- a/compile.php +++ b/compile.php @@ -297,13 +297,13 @@ function php_shrink($input) { $doc_comment = true; $token[1] = substr_replace($token[1], "* @version $VERSION\n", -2, 0); } - if (($token[0] == T_VAR || $token[0] == T_PUBLIC || $token[0] == T_PROTECTED || $token[0] == T_PRIVATE) && $tokens[$i+2][1][0] == '$') { - if ($token[0] == T_PUBLIC) { + 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'; } $shortening = false; } elseif (!$shortening) { - if ($token[1] == ';') { + if ($token[1] == ';' || $token[0] == T_FUNCTION) { $shortening = true; } } elseif ($token[0] == T_ECHO) {