How to store PHP code inside heredoc variable?
<p>I would like to store the following code inside a HEREDOC variable:</p>

<pre><code>&lt;?php

$var = 'test';
echo $var;

?&gt;
</code></pre>

<p>like that:</p>

<pre><code>$hered = &lt;&lt;&lt;HERED
&lt;?php

$var = 'test';
echo $var;

?&gt;
HERED;
</code></pre>

<p>The problem is that HEREDOC works like double quotes <code>""</code> - that means each dollar sign (<code>$</code>)have to be replaced with <code>\$</code>...</p>

<p>Is there a way to use HEREDOC without performing such operation?</p>
