Re:Modern PHP Cheat Sheet
by vessel on Thursday November 25, 2021 @07:26AM
(#29340748)
The reason I never use Heredoc is because you need to abandon your indentation, otherwise your tabs/spaces get included in the string. Is there a way around that?
[ Parent
| on HN ]
Not since PHP 7.3![1] If you indent the closing identifier, then the corresponding indentation will be removed from the content of the heredoc string.
[1]: https://www.php.net/manual/en/language.types.string.php#lang...
Re:Modern PHP Cheat Sheet
by TrispusAttucks on Thursday November 25, 2021 @07:34AM
(#29340804)
I thought they fixed this with [1] Flexible Heredoc in 2017 with PHP 7.3
[1] https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes