They allow for multiline strings without have to worry about backslashing your quoting delimiter. Here-docs can be used in ANY place where a normal quoted string would be used. This document is presented using a modified BNF grammar notation. Literal strings are enclosed in quotes.
White space is only meaningful to separate tokens.
Programs ending with a terminator and no trailing newline will complain that the terminator was never found. The quotes used around an identifier change the way the body of the here-doc is interpreted. That means that you needn't backslash a backslash. If double quotes are used, the body is treated as a double-quoted string, and all interpolation is done as such. If you use no identifier, or an identifier without quotes, double quoted interpolation is also performed.