fix: align server globals with PHP CLI

pull/39/head
韩天峰 4 weeks ago
parent 620c9e2ab1
commit d7de18f993
  1. 4
      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) {

Loading…
Cancel
Save