private function doRun($function)
    {
        $raw = $this->execute($function, $this->functions, array_slice(func_get_args(), 1));
        if (
            ($this->autoescape && ! in_array($function, $this->safe, true))
            && (is_array($raw) || is_string($raw) || (is_object($raw) && ! $raw instanceof Extension))
        ) {
            $raw = $this->escaper->escape($raw);
            if (is_object($raw)) {
                $raw = '';
            }
        }

        return is_null($raw) ? '' : $raw;
    }