[php] PHP using Gettext inside <<<EOF string

I use PHP's EOF string to format HTML content without the hassle of having to escape quotes etc. How can I use the function inside this string?

<?php
    $str = <<<EOF
    <p>Hello</p>
    <p><?= _("World"); ?></p>
EOF;
    echo $str;
?>

This question is related to php gettext eof

The answer is


As far as I can see, you just added heredoc by mistake
No need to use ugly heredoc syntax here.
Just remove it and everything will work:

<p>Hello</p>
<p><?= _("World"); ?></p>