Bug #68033 [Opn->Nab]: nowdoc,heredoc doesn't work with .=
| From: | requinix@php.net | Date: | Wed, 17 Sep 2014 05:09:38 +0000 |
| Subject: | Bug #68033 [Opn->Nab]: nowdoc,heredoc doesn't work with .= | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187560@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68033&edit=1
ID: 68033
Updated by: requinix@php.net
Reported by: jmichae3 at yahoo dot com
Summary: nowdoc,heredoc doesn't work with .=
-Status: Open
+Status: Not a bug
Type: Bug
Package: Scripting Engine problem
Operating System: win7ult64sp1retail
PHP Version: 5.6.0
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
Big red warning.
Previous Comments:
------------------------------------------------------------------------
[2014-09-17 05:08:06] jmichae3 at yahoo dot com
Description:
------------
in my menu generation code (not this script, but similar, php acts differently. instead of
generating an error (it should not), it fails silently and appends the following PHP source code
into the string in addition to the string content itself, up to a certain point.
the HTML output from PHP from the pastebin code ends up being
http://pastebin.com/78Mx80V2
$s .= printbreadcrumbsmenu($xmlArray, $filepath,
/*array('LI','USER','USERS','VISITOR','VISITORS'),
*/true);
$s .= printbreadcrumbsmenu($xmlArray, $filepath,
/*array('MODERATOR','MODERATORS'), */false);
$s .= printbreadcrumbsmenu($xmlArray, $filepath,
/*array('ADMIN','ADMINS','ADMINISTRATOR','ADMINISTRATORS'),
*/false);
$s .= printbreadcrumbsmenu($xmlArray, $filepath,
/*array('LEADERSHIP','LEADERS','LEADER'), */false);
$s .= " </div>\n";
$s .= <<<'EOT'
and
EOT;
if ((bool)$isxhtml) {
$s .= $menuhelptextx;
} else {
$s .= $menuhelptext;
}
$s .= <<<'EOT'
should not be there in the generated HTML source, those are php functions. it seems like php is
ignoring the EOT;
Test script:
---------------
<?php
$s="";
$s.= <<<'EOT'
this is <html lang='en'>
<title>a title</title>
EOT;
echo $s;
?>
http://pastebin.com/fE5CaVEE for the one mentioned in
Description.
Expected result:
----------------
should follow the manual in how it works. should not work just for initialization only but for
concatenation, and echo as well, any place where you can use a string.
expected HTML output: http://pastebin.com/SYQ4GSWG
Actual result:
--------------
EOT; ignored and therefore php source code is included into the string including the EOT; (until
when?)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68033&edit=1