Skip to content

Commit cb45c5d

Browse files
committed
add note about PHP 7.3 flexible heredoc/nowdoc
1 parent 174ed47 commit cb45c5d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

peps/pep-0822.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,12 @@ C# 11 also introduced a similar feature called `Raw String Literals <https://lea
226226
`Swift <https://docs.swift.org/swift-book/documentation/the-swift-programming-language/stringsandcharacters/#Multiline-String-Literals>`__
227227
also support triple-quoted string literals that automatically remove indentation.
228228

229+
PHP 7.3 introduced `Flexible Heredoc and Nowdoc Syntaxes <https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes>`__
230+
Although it uses closing marker (e.g. ``<<<END ... END``) instead of triple quote,
231+
it removes indent from text too.
232+
229233
Java and Julia uses the least-indented line to determine the amount of indentation to be removed.
230-
Swift and C# uses the indentation of the closing triple quotes, similar to this PEP.
234+
Swift, C#, and PHP uses the indentation of the closing triple quotes or closing marker.
231235

232236
This PEP chose the Swift and C# approach because it is more simple and easy to explain.
233237

0 commit comments

Comments
 (0)