php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47516 nowdoc can not be embed in heredoc but can be embed in double quote
Submitted: 2009-02-27 03:36 UTC Modified: 2009-03-26 12:39 UTC
Votes:1468
Avg. Score:5.0 ± 0.0
Reproduced:1468 of 1468 (100.0%)
Same Version:1468 (100.0%)
Same OS:1468 (100.0%)
From: kexianbin at diyism dot com Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3CVS-2009-02-27 (snap) OS: windows xp
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kexianbin at diyism dot com
New email:
PHP Version: OS:

 

 [2009-02-27 03:36 UTC] kexianbin at diyism dot com
Description:
------------
why nowdoc can not be embed in heredoc but can be embed in double quote?

Why the second paragraph is right(using double quote),
while the commented is not right(using nowdoc)?

<?
$s='substr';

/*
$htm=<<<DOC
{$s(<<<'ppp'
abcdefg
ppp
,0,3)}
DOC;
*/

$htm="
{$s(<<<'ppp'
abcdefg
ppp
,0,3)}
";

echo $htm;
?>

Expected result:
----------------
Output 'abc'

Actual result:
--------------
Output:
Parse error: parse error, expecting `'}''

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-26 12:39 UTC] dmitry@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Nov 21 15:00:01 2025 UTC