Finally found the problem, the original document at the end, must be close to the first line, that is, EOF front can not have spaces, and in order to code indentation, just created such a problem.
Copy Code code as follows:
$str = <<< ' EOD '
Example of String
Spanning multiple lines
Using Nowdoc syntax.
Eod;//eod must be close to the front, can not have spaces, while not missing the end of the semicolon;
attachment: The difference between Heredoc and Nowdoc
Heredoc uses <<< EOT identifiers, and Nowdoc uses identifiers such as <<< ' EOT '. Nowdoc is the introduction of PHP5.3 new technology, it contains the Heredoc syntax, but the content will not be any escape and interpretation, what content is what content, will not parse PHP-related content
The PHP variables in Heredoc are recommended to be enclosed in {$name->change ()} braces to avoid ambiguity, and if you want to output as is, you can use the legendary escape character \, the escape character itself can be exported using the escape character, that is, the representation method, Braces like these all need to escape the output.
In order to ensure that it is available, it is recommended that the syntax of Heredoc be used with escape, because the Nowdoc syntax introduced by PHP5.3, many cloud hosting environments may not support the cause of the leftovers.
Finally, the Heredoc is introduced from the PHP4.0, and Nowdoc syntax requires 5.3 version, because the Heredoc contains Nowdoc function, so personal advice or use heredoc better.
In simple terms:
1, Heredoc is dynamic nowdoc is static
2, heredoc similar to multiline double quotes Newdoc single quotes similar to multiple lines
3, Heredoc is a general-purpose processing scheme that deals with large segments of strings. And Nowdoc is PHP to make up for the dynamic implementation of the "heredoc" efficiency problem to achieve the "efficient" static version of the