Req #76609 [NEW]: Flexible heredocs should not have special indentation rules
| From: | mattacosta at gmail dot com | Date: | Wed, 11 Jul 2018 03:24:07 +0000 |
| Subject: | Req #76609 [NEW]: Flexible heredocs should not have special indentation rules | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-216269@lists.php.net to get a copy of this message | ||
From: mattacosta at gmail dot com
Operating system:
PHP version: 7.3.0alpha3
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:Flexible heredocs should not have special indentation rules
Description:
------------
Flexible heredocs require that indentation only consist of spaces or
tabs, but not both. This could be a problem for code embedded in other
files.
Instead of requiring that the indentation exactly match the indentation
prior to the end label *and* not have mixed whitespace, it should just
exactly match the indentation.
Generally speaking, the language shouldn't decide what indentation is
good or bad either. The user should.
Test script:
---------------
<!-- This would be aligned if the tab size were 4 instead of 8. -->
<html>
<body
text="<?= <<<LABEL
3 tabs
and
2 spaces
LABEL?>"
attr="hello-world">
</body>
</html>
Expected result:
----------------
<!-- Mixed or not this would be the same. -->
<html>
<body
text="3 tabs
and
2 spaces"
attr="hello-world">
</body>
</html>
Actual result:
--------------
Parse error: Invalid indentation - tabs and spaces cannot be mixed
--
Edit bug report at https://bugs.php.net/bug.php?id=76609&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76609&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76609&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76609&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76609&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76609&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76609&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76609&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76609&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76609&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76609&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76609&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76609&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76609&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76609&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76609&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76609&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76609&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76609&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76609&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76609&r=mysqlcfg