code: public static function getAllHeaders()
      {
          if (\function_exists('getallheaders')) {
              return \getallheaders();
          }
          $headers = array();
          $copyServer = array(
              'CONTENT_TYPE'   => 'Content-Type',
              'CONTENT_LENGTH' => 'Content-Length',
              'CONTENT_MD5'    => 'Content-Md5',
          );
          foreach ($_SERVER as $key => $value) {
              if (\substr($key, 0, 5) === 'HTTP_') {
                  $key = \substr($key, 5);
                  if (!isset($copyServer[$key]) || !isset($_SERVER[$key])) {
                      $key = \str_replace(' ', '-', \ucwords(\strtolower(\str_replace('_', ' ', $key))));
                      $headers[$key] = $value;
                  }
              } elseif (isset($copyServer[$key])) {
                  $headers[$copyServer[$key]] = $value;
              }
          }
          if (!isset($headers['Authorization'])) {
              if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
                  $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
              } elseif (isset($_SERVER['PHP_AUTH_USER'])) {
                  $basicPass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';
                  $headers['Authorization'] = 'Basic ' . \base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basicPass);
              } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) {
                  $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST'];
              }
          }
          return $headers;
      }
docs: Get all HTTP header key/values as an associative array for the current request.
  
  @return string[string] The HTTP header key/value pairs.