Bug #68033 [NEW]: nowdoc,heredoc doesn't work with .=
| From: | jmichae3 at yahoo dot com | Date: | Wed, 17 Sep 2014 05:08:07 +0000 |
| Subject: | Bug #68033 [NEW]: nowdoc,heredoc doesn't work with .= | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187559@lists.php.net to get a copy of this message | ||
From: jmichae3 at yahoo dot com
Operating system: win7ult64sp1retail
PHP version: 5.6.0
Package: Scripting Engine problem
Bug Type: Bug
Bug description:nowdoc,heredoc doesn't work with .=
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 bug report at https://bugs.php.net/bug.php?id=68033&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68033&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68033&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68033&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68033&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68033&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68033&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68033&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68033&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68033&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68033&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68033&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68033&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68033&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68033&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68033&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68033&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68033&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68033&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68033&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68033&r=mysqlcfg