Req #76609 [Opn->Wfx]: Flexible heredocs should not have special indentation rules
| From: | requinix@php.net | Date: | Wed, 11 Jul 2018 03:31:42 +0000 |
| Subject: | Req #76609 [Opn->Wfx]: Flexible heredocs should not have special indentation rules | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216270@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76609&edit=1
ID: 76609
Updated by: requinix@php.net
Reported by: mattacosta at gmail dot com
Summary: Flexible heredocs should not have special
indentation rules
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
Package: *General Issues
PHP Version: 7.3.0alpha3
Block user comment: N
Private report: N
New Comment:
Flexible heredocs was thoroughly discussed.
https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes
> These [unmixed whitespace] constraints have been included because mixing tabs and spaces for
> indentation is
> harmful to legibility.
Previous Comments:
------------------------------------------------------------------------
[2018-07-11 03:24:04] mattacosta at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=76609&edit=1