Bug #81300 [NEW]: Heredocs closing identifiers

From: Date: Mon, 26 Jul 2021 14:34:03 +0000
Subject: Bug #81300 [NEW]: Heredocs closing identifiers
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235369@lists.php.net to get a copy of this message
From:             forums at artfulrobot dot uk
Operating system: Linux
PHP version:      7.3.29
Package:          Reproducible crash
Bug Type:         Bug
Bug description:Heredocs closing identifiers 

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 bug report at https://bugs.php.net/bug.php?id=81300&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81300&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81300&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81300&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81300&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81300&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81300&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81300&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81300&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81300&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81300&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81300&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81300&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81300&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81300&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81300&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81300&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81300&r=mysqlcfg


Thread (1 message)

  • forums at artfulrobot dot uk
« previous php.bugs (#235369) next »