src/Request.php
public static function replaceEnv(&$env, $key, $value) {
        $key = strtoupper($key);

        $result = null;
        if (isset($env[$key])) {
            $result = $env[$key];
            $env[$key.'_RAW'] = $result;
        }
        $env[$key] = $value;
        return $result;
    }
public static function replaceEnv(&$env, $key, $value) {
        $key = strtoupper($key);

        $result = null;
        if (isset($env[$key])) {
            $result = $env[$key];
            $env[$key.'_RAW'] = $result;
        }
        $env[$key] = $value;
        return $result;
    }
Replace an environment variable with another one and back up the old one in a *_RAW key.

@param array &$env The environment array.
@param string $key The environment key.
@param mixed $value The new environment value.
@return mixed Returns the old value or null if there was no old value.