-
Notifications
You must be signed in to change notification settings - Fork 163
Open
Description
Please complete the information below:
Where is the problem?
On the Source Code Fundamentals: Literals page, in the section about nowdoc string literals.
What is the problem?
The page says:
The two forms of string literal (heredoc, nowdoc) have the same semantics and constraints except that nowdoc literals do not support variable substitution.
However, there is an additional distinction not mentioned on this page: nowdocs also do not support backslash escapes. For example, the following will be parsed as a backslash and an n, not as a newline character:
$x = <<<EOT
\n
EOTIt's close to, but not quite, the same distinction as double-quoted and single-quoted strings (in single-quoted strings, \' is a single quote, but in a nowdoc, it seems to be two characters).
Please don't change anything below this point.
- Build ID: HHVM=HHVM-4.164.0:HSL=v4.108.1:2024-02-08T13:44:46+0000:1fa47f258c6b68f8ec01899aa82fd6ffa0957109
- Page requested: /hack/source-code-fundamentals/literals
- Page requested at: Thu, 22 May 2025 00:12:05 +0000
- Controller: GuidePageController
Metadata
Metadata
Assignees
Labels
No labels