Bug->Doc #81300 [Opn->Dup]: Heredocs closing identifiers
| From: | cmb@php.net | Date: | Mon, 26 Jul 2021 14:58:30 +0000 |
| Subject: | Bug->Doc #81300 [Opn->Dup]: Heredocs closing identifiers | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18996@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81300&edit=1
ID: 81300
Updated by: cmb@php.net
Reported by: forums at artfulrobot dot uk
Summary: Heredocs closing identifiers
-Status: Open
+Status: Duplicate
-Type: Bug
+Type: Documentation Problem
-Package: Reproducible crash
+Package: Scripting Engine problem
Operating System: Linux
PHP Version: 7.3.29
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
See <https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes>.
Closing as duplicate of bug #78425.
Previous Comments:
------------------------------------------------------------------------
[2021-07-26 14:34:03] forums at artfulrobot dot uk
Description:
------------
---
From manual page: https://php.net/language.types.string
---
It appears that since 7.3 a heredoc may never include the heredoc identifier if it is the first item
on an indented line.
Before 7.3, the interpretation was as described in the docs: indentation means the identifier would
be considered part of the enclosed text. Which made sense.
Test script:
---------------
// In 7.2, this works, in 7.3+ it fails, misinterpreting the indented "SOMETHING"
// on the 2nd line as closing the heredoc.
$string = <<<SOMETHING
SOMETHING weird is going on.
SOMETHING;
Actual result:
--------------
**unexpected 'is' (T_STRING)**
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81300&edit=1