Skip to content
Closed
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
33 changes: 17 additions & 16 deletions language/types/string.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@
</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 doc 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 @@
<programlisting role="php">
<![CDATA[
<?php
// no indentation
// closing identifier not indented
echo <<<END
a
b
c
\n
END;

// 4 spaces of indentation

Check failure on line 244 in language/types/string.xml

View workflow job for this annotation

GitHub Actions / DocBook Style Check (en)

string.xml: Trailing whitespace detected.
// 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 @@
b
c

a
b
c
a
b
c
]]>
</screen>
</example>
Expand Down Expand Up @@ -308,23 +309,23 @@

// different indentation for body (spaces) and ending marker (tabs)
{
echo <<<END
a
END;
echo <<<END
a
END;
}

// mixing spaces and tabs in body
{
echo <<<END
a
a
END;
}

// mixing spaces and tabs in ending marker
{
echo <<<END
a
END;
echo <<<END
a
END;
}
]]>
</programlisting>
Expand Down
Loading