Code: Select all
"Fine"
$msg = <<<HEREDOC
Here be dragons!
HEREDOC;
End 0, "$msg", 1;
//No stop! Don't try to parse me!
Echo "Jolly oh!";
"Also Fine"
End 0, <<<HEREDOC
Here be dragons!
HEREDOC;
//No stop! Don't try to parse me!
Echo "Jolly oh s'more!";
"F7U12"
End 0, <<<HEREDOC
Here be dragons!
HEREDOC
, 1;
//No stop! Don't try to parse me!
Echo "Oh dear!";
"Not you too!"
End 0, <<<HEREDOC
Here be dragons!
HEREDOC
, 1;
/*No stop! Don't try to parse me!*/
Echo "Oh fudge!";It is said that Heredoc is very similar to all other types of strings in most ways, but that when surrounded by arguments it will strike out and attack the next comment that it finds. Heredoc infects that comment and convinces it to believe it is not just an empty vessel in this world but an all important part of the community that must be treated like the Functions and Commands it lives with!
The poor comment overtaken by these illusions of grandeur carries along with it the curse until at the most inconvenient time it infects and destroys the entire village! But by now the Heredoc has had plenty of time to escape and hide in wait for its next opportunity to spread evil.
If the legend is to be trusted there is only one man whom wields the power to break this curse... but until that dawn arrives village after village will fall to the Curse of the Sandwiched Heredoc!
TL;DR: Using HEREDOC as an interior argument causes the parser to attempt to execute the next comment it finds. Yielding not so hilarious results.
XYplorer Beta Club