private function getDoubleQuotedString($string, $options)
    {
        $string = strtr($string, [
            "\n" => '\n',
            "\r" => '\r',
            "\t" => '\t',
            '$' => '\$',
            '"' => '\"',
            '\\' => '\\\\',
        ]);

        if ($options['string.utf8']) {
            $string = $this->encodeUtf8($string, $options);
        }

        $hexFormat = function ($matches) use ($options) {
            return sprintf($options['hex.capitalize'] ? '\x%02X' : '\x%02x', \ord($matches[0]));
        };

        return sprintf('"%s"', preg_replace_callback('/[^\x20-\x7E]/', $hexFormat, $string));
    }