What is the purpose of EOF and LIST in PHP heredoc syntax?
The purpose of EOF (End Of File) and LIST in PHP heredoc syntax is to provide a way to define multi-line strings without having to escape special characters. EOF is used to mark the end of the heredoc string, while LIST allows for the assignment of variables within the heredoc block.
// Using EOF and LIST in PHP heredoc syntax
$name = 'John';
$age = 30;
$string = <<<EOF
Hello $name,
You are $age years old.
EOF;
echo $string;