Re: One-line heredoc for better syntax highlightning
| From: | Tim Düsterhus | Date: | Mon, 19 Sep 2022 15:58:37 +0000 |
| Subject: | Re: One-line heredoc for better syntax highlightning | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118658@lists.php.net to get a copy of this message | ||
Hi
On 9/19/22 16:24, Olle Härstedt wrote:
$query = <<<MySQL SELECT * FROM foo MySQL; It would be nice if this feature could be used in single lines as well: $query = <<<MySQL SELECT * FROM foo MySQL;I don't find that example particularly readable or convincing. It mushes together PHP and MySQL keywords too much. Once you add a WHERE clause that SQL query should be split across multiple multiple lines for readability anyway and even for that very simple example I personally would add a linebreak in front of the FROM: $query = <<<MySQL
SELECT *
FROM foo
MySQL;
Best regards
Tim Düsterhus