Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions language/types/string.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ echo 'Variables do not $expand $either', PHP_EOL;
</simpara>

<simpara>
The closing identifier may be indented by space or tab, in which case
the indentation will be stripped from all lines in the doc string.
The closing identifier may be indented with spaces or tabs. Whitespace
equal to the closing identifier's indentation is then removed from the
beginning of every line in the Heredoc string.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
beginning of every line in the Heredoc string.
beginning of every line in the heredoc string.

Prior to PHP 7.3.0, the closing identifier <emphasis>must</emphasis>
begin in the first column of the line.
</simpara>
Expand All @@ -233,20 +234,20 @@ echo 'Variables do not $expand $either', PHP_EOL;
<programlisting role="php">
<![CDATA[
<?php
// no indentation
// closing identifier not indented
echo <<<END
a
b
c
\n
END;

// 4 spaces of indentation
// closing identifier indented with 3 spaces; 3 spaces stripped from each line
echo <<<END
a
b
c
END;
END;
]]>
</programlisting>
&example.outputs.73;
Expand All @@ -256,9 +257,9 @@ echo <<<END
b
c

a
b
c
a
b
c
]]>
</screen>
</example>
Expand Down