I am getting a php error
unexpected end of file
John:-'do you have new car?"<br>Lilly:-"yes I have BMW" msg;
Tom, I think you did not read the manual carefully,
"Manual says that the closing indentifier of heredoc must be clean, but in your code, you did not follow this rule"
Your closing identifier msg; is not following the heredoc syntax rule.
Closing identifier must come in a new line with no other characters except the closing identifier followed by a semicolon (;). if this rule is broken and closing indentifier is not clean, php will continue looking for one if no indentifier is found at the end of the file then php will produce an error.
in your code , closing identifier Was not placed in the new line, that's why you were getting syntax errors.
<?Php $x=<<<msg John:-'do you have new car?"<br>Lilly:-"yes I have BMW" msg; echo $x; ?>
See the demo https://eval.in/302325