Doc #64943 [Opn->Csd]: Heredoc syntax specification
| From: | krakjoe@php.net | Date: | Fri, 04 Oct 2013 17:31:07 +0000 |
| Subject: | Doc #64943 [Opn->Csd]: Heredoc syntax specification | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10416@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64943&edit=1
ID: 64943
Updated by: krakjoe@php.net
Reported by: jduartedj at gmail dot com
Summary: Heredoc syntax specification
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: krakjoe
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2013-10-04 17:30:46] krakjoe@php.net
Automatic comment from SVN on behalf of krakjoe
Revision: http://svn.php.net/viewvc/?view=revision&revision=331668
Log: #64943 clarity in description
------------------------------------------------------------------------
[2013-05-29 17:20:38] sixd@php.net
Both issues are already covered in the doc.
I agree the first one could be made more obvious: currently that page says "After this
operator, an identifier is provided, then a newline." This could be
improved.
The warning box is already very clear about your second point:
"It is very important to note that the line with the closing identifier must
contain no other characters, except possibly a semicolon (;)." This could also
be improved because the semicolon is mandatory.
------------------------------------------------------------------------
[2013-05-29 15:08:23] jduartedj at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/language.types.string
---
It is not mentioned that heredoc syntax requires:
* NO SPACE after each identifier
* NO CHARACTERS before the END identifier
Test script:
---------------
//PROPER
echo <<<EOS
my freestyle text
EOS;
//IMPROPER (space after "<<<EOS")
echo <<<EOS
my freestyle text
EOS;
//IMPROPER (space after "EOS;")
echo <<<EOS
my freestyle text
EOS;
//IMPROPER (spaces before "EOS;")
echo <<<EOS
my freestyle text
EOS;
Expected result:
----------------
Fail all except first
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64943&edit=1