In PHP 4, this:
$test = 'test';
$text = <<<EOT
This is a $test
EOT;
produces: "This is a test".
But I want a non-interpolated heredoc that would produce: "This is a $test".
I'm trying to pull arbitrary inline text (with all kinds of special characters-- ', ", $, \, etc.) into a variable and I don't want it screwing with any of the contents (NON-INTERPOLATED)! There has to be a way to do this...
In Perl, you can turn off interpolation by using tick marks around the closing token:
$text = <<'EOT';
This is a $test
EOT
But that syntax (using the tick marks like that) doesn't work with PHP's <<< operator.
And please don't ask me to assign '$test' to $test as a solution-- I need something that works without knowing beforehand what the content within the heredoc section will be.
Thanks!