From d7de18f99350d43a81400c697b6b7b73267d9ee1 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Thu, 30 Jul 2026 18:01:07 +0800 Subject: [PATCH] fix: align server globals with PHP CLI --- src/Translator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Translator.php b/src/Translator.php index 6faa767d..cc5b5baa 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -693,8 +693,8 @@ class Translator extends Preprocessor // Embedded binaries populate the CLI script fields in $_SERVER at // request startup, even when the source does not reference $_SERVER. - if ($this->isBuildModeBin() && !isset($this->globalVars['_SERVER'])) { - $this->globalVars['_SERVER'] = Type::ARRAY; + if ($this->isBuildModeBin() && !$this->hasGlobalVar('_SERVER')) { + $this->addGlobalVar('_SERVER', Type::ARRAY); } foreach ($this->globalVars as $name => $type) {