private function compileEchos($expr, $escaped)
    {
        $tags = $escaped ? ['{{', '}}'] : ['{!!', '!!}'];
        $pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', $tags[0], $tags[1]);

        return preg_replace_callback($pattern, function ($matches) use ($escaped) {
            $content = $this->compileEchoDefaults($matches[2]);
            if ($escaped) {
                $content = sprintf('e(%s)', $content);
            }

            if ($matches[1]) {
                // The expression begins with "@{{" or "@{!!". Don't compile this part!
                return substr($matches[0], 1);
            }

            // If the expression ends with a line feed, we need a additional line feed.
            $lineFeeds = !empty($matches[3]) ? $matches[3] . $matches[3] : '';

            return '<?php echo ' . $content . '; ?>' . $lineFeeds;
        }, $expr);
    }