out.println("Value q_oldThis = env.setThis(q_this_arg);");
out.println("Value q_oldThis = env.setThis(q_this);");
  private void generateBody(PhpWriter out)    throws IOException  {    out.println("env.checkTimeout();");    out.println();    for (VarInfo var : _info.getVariables()) {      String varName = "v_" + var.getName();      String argName = varName;      if (! var.isArgument())        out.print("Value ");      else if (isVariableArgs()) {        out.print("Value ");        argName = "args[" + var.getArgumentIndex() + "]";      }      if (var.isArgument()) {        if (isVariableMap()) {	  if (var.isRefArgument()) {	    // php/3214	    out.println(varName + " = " + argName + ".toRefVar();");	  }	  else	    out.println(varName + " = " + argName + ".toVar();");        }        else if (var.isReadOnly() && var.isValue()) {          // php/3a70, php/343k          out.println(varName + " = " + argName + ".toArgValue();");        }        else if (var.isReadOnly()) {          // php/3783          out.println(varName + " = " + argName + ".toRefValue();");        }        else if (var.isRefArgument()) {          // php/344r, 3a57          out.println(varName + " = " + argName + ".toRefVar();");        }        else if (var.isAssigned() && var.isReference()) {          out.println(varName + " = " + argName + ".toVar();");        }        else {          // php/399j          out.println(varName + " = " + argName + ".toArgValue();");        }      }      else {        // local variable, i.e. not argument        if (var.isValue())          out.println(varName + " = NullValue.NULL;");        else          out.println(varName + " = null;");      }    }    for (String var : _info.getTempVariables()) {      out.println("Value " + var + ";");    }    if (isVariableMap()) {      out.println("java.util.HashMap<String,Var> _quercus_map = new java.util.HashMap<String,Var>();");      out.println("java.util.HashMap<String,Var> _quercus_oldMap = env.pushEnv(_quercus_map);");      if (! isStatic())	out.println("Value q_oldThis = env.setThis(q_this_arg);");            out.println("try {");      out.pushDepth();      for (int i = 0; i < _args.length; i++) {        out.print("_quercus_map.put(\"");        out.printJavaString(_args[i].getName());        out.println("\", (Var) v_" + _args[i].getName() + ");");      }    }    _statement.generate(out);    if (isVariableMap()) {      out.popDepth();      out.println("} finally {");      out.pushDepth();      // out.println("env.setFunctionArgs(_quercus_oldArgs);");      out.println("env.popEnv(_quercus_oldMap);");      if (! isStatic())	out.println("env.setThis(q_oldThis);");            out.popDepth();      out.println("}");    }    if (_statement.fallThrough() != Statement.RETURN)      out.println("return com.caucho.quercus.env.NullValue.NULL;");  }