case _COOKIE: case HTTP_COOKIE_VARS: {
case HTTP_COOKIE_VARS: if (! getIniBoolean("register_long_arrays")) return null; case _COOKIE: {
  public Var getSpecialRef(String name)  {    Var var = null;    switch (SPECIAL_VARS.get(name)) {    case _ENV: {      var = new Var();      _globalMap.put(name, var);      var.set(new ArrayValueImpl());      return var;    }    case HTTP_POST_VARS:    case _POST: {      var = new Var();      _globalMap.put(name, var);      ArrayValue post = new ArrayValueImpl();      if (_post != null) {        for (Map.Entry<Value, Value> entry : _post.entrySet()) {          post.put(entry.getKey(), entry.getValue());        }      }      var.set(post);      ArrayList<String> keys = new ArrayList<String>();      keys.addAll(_request.getParameterMap().keySet());      Collections.sort(keys);      for (String key : keys) {        String []value = _request.getParameterValues(key);        Post.addFormValue(post, key, value, getIniBoolean("magic_quotes_gpc"));      }    }    break;    case HTTP_POST_FILES:    case _FILES: {      var = new Var();      _globalMap.put(name, var);      ArrayValue files = new ArrayValueImpl();      if (_files != null) {        for (Map.Entry<Value, Value> entry : _files.entrySet()) {          files.put(entry.getKey(), entry.getValue());        }      }      var.set(files);    }    break;    case _GET:    case _REQUEST:    case HTTP_GET_VARS: {      var = new Var();      ArrayValue array = new ArrayValueImpl();      var.set(array);      _globalMap.put(name, var);      ArrayList<String> keys = new ArrayList<String>();      keys.addAll(_request.getParameterMap().keySet());      Collections.sort(keys);      for (String key : keys) {        String []value = _request.getParameterValues(key);        Post.addFormValue(array, key, value, getIniBoolean("magic_quotes_gpc"));      }      if (name.equals("_REQUEST") && _post != null) {        for (Map.Entry<Value, Value> entry : _post.entrySet()) {          array.put(entry.getKey(), entry.getValue().copy());        }      }      return var;    }    case HTTP_SERVER_VARS:    case _SERVER: {      var = new Var();      _globalMap.put(name, var);      var.set(new ServerArrayValue(this));      return var;    }    case _GLOBAL: {      var = new Var();      _globalMap.put(name, var);      var.set(new GlobalArrayValue(this));      return var;    }    case _COOKIE:    case HTTP_COOKIE_VARS: {      var = new Var();      _globalMap.put(name, var);      ArrayValue array = new ArrayValueImpl();      Cookie []cookies = _request.getCookies();      if (cookies != null) {        for (int i = 0; i < cookies.length; i++) {          Cookie cookie = cookies[i];          String value = decodeValue(cookie.getValue());          StringValue valueAsValue;	  // PHP 6 removes magic_quotes	  /*          if (getIniBoolean("magic_quotes_gpc"))            valueAsValue = StringModule.addslashes(value);          else	  */	  valueAsValue = new StringValueImpl(value);          array.append(new StringValueImpl(cookie.getName()), valueAsValue);        }      }      var.set(array);      _globalMap.put(name, var);      return var;    }    case PHP_SELF: {      var = new Var();      _globalMap.put(name, var);      var.set(getGlobalVar("_SERVER").get(PHP_SELF_STRING));      return var;    }    default: {      if (_scriptContext != null) {	Object value = _scriptContext.getAttribute(name);	if (value != null) {	  var = new Var();	  _globalMap.put(name, var);	  var.set(wrapJava(value));	  return var;	}      }    }    }    return var;  }