|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #81300 Heredocs closing identifiers
Submitted: 2021-07-26 14:34 UTC Modified: 2021-07-26 14:58 UTC
From: forums at artfulrobot dot uk Assigned: cmb (profile)
Status: Duplicate Package: Scripting Engine problem
PHP Version: 7.3.29 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: forums at artfulrobot dot uk
New email:
PHP Version: OS:


 [2021-07-26 14:34 UTC] forums at artfulrobot dot uk
From manual page:

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.

Actual result:
**unexpected 'is' (T_STRING)** 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-26 14:58 UTC]
-Status: Open +Status: Duplicate -Type: Bug +Type: Documentation Problem -Package: Reproducible crash +Package: Scripting Engine problem -Assigned To: +Assigned To: cmb
 [2021-07-26 14:58 UTC]
See <>.
Closing as duplicate of bug #78425.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 19:01:29 2024 UTC