Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118663 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36680 invoked from network); 19 Sep 2022 19:23:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Sep 2022 19:23:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E255E18033A for ; Mon, 19 Sep 2022 12:23:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 19 Sep 2022 12:23:10 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id h3so393352lja.1 for ; Mon, 19 Sep 2022 12:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date; bh=2NvM3nFkySPW2ALP5suvHwHhF0rDcUGsgBJQqho5Jx8=; b=WPFh2JqNkXX6butj12eFQivgNolcFEXlXNGAzog+bSqlblVCb3Cugh4rp22qY/Sz1F WI4Igme3ge+Bk7AHsR1gjXVskLkwH2zLvB3LFo40LeToFI1Dz2xAu+ifSHjaYOodRO+a VddGmf4vwcho6+y2me/3MCnrNogcNkb8GhHUBhtX455jl1gd1/WZy5s3bBZVKhG0XadQ MyD9wNglPShjjOpd8f3rQfMS9Yj/J9thqREVvu+KMJMrH9bsune3kRY9sajjHFXIPGe7 s42tAP0Uo5+w4TxTgBe7+Zf7C4+FDzMTdDPuwL8lwuIJeMIsVLikhnpldgI3MIjH7Spu hVWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=2NvM3nFkySPW2ALP5suvHwHhF0rDcUGsgBJQqho5Jx8=; b=NHQG/pd3Z0PJLrbOOwc6Z2rTVNHZMFoPmwPFlKnxyxas6gfyS3h1m6F22asguQYPom djjp7czDHK93H5y9MvWexEvt5pvSeQ8RlUoH13w4FE2XwS6s2BrR8I0pS8p0bWfY50M1 IktKTUjf8oOwAX/niLW/CQZ0LuGooJbvj4byP8KeopRgMpRErJgltpPHKT+Gr8xKBJ1k v8GWLvr+uuRvmXGRx/hlYWQ7leKp62zgHJQacPfy4cQFMt9t7yeEQWP2TmdHal8MCwOE Aca16lZOa9sag079BHjtEuvSWrbFmKYHw0TAjpbuds56gSY0qPyeG34jLuOY0hCmy+Ax bvMQ== X-Gm-Message-State: ACrzQf0mcNVbkZSxDiORiMTw6sKtdGFFAwVTlrJEu+6JWDWE5USgFbS2 Dqdzuld6MKJQctlrfn7QC8pngsR6XjYNkg48Kpjogp6G X-Google-Smtp-Source: AMsMyM786ySQMnXob9NpTgK0iTdtvPION5/IvGztbPmvWHA3ULjBZQeIlJc59K1uGz8Vh6HcxxWhjFNll0bHEeY4qAA= X-Received: by 2002:a2e:a4a3:0:b0:26c:16cd:7e47 with SMTP id g3-20020a2ea4a3000000b0026c16cd7e47mr6089509ljm.511.1663615389093; Mon, 19 Sep 2022 12:23:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5303:0:0:0:0:0 with HTTP; Mon, 19 Sep 2022 12:23:08 -0700 (PDT) In-Reply-To: <25c35b20-7fcf-fa10-90ae-0ce5aedc11b4@bastelstu.be> References: <25c35b20-7fcf-fa10-90ae-0ce5aedc11b4@bastelstu.be> Date: Mon, 19 Sep 2022 21:23:08 +0200 Message-ID: To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] One-line heredoc for better syntax highlightning From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) 2022-09-19 21:18 GMT+02:00, Tim D=C3=BCsterhus : > Hi > > On 9/19/22 21:04, Olle H=C3=A4rstedt wrote: >> That looks good in isolation, but consider the following short snippet: >> >> class Foo >> { >> public function bar() >> { >> $query =3D <<> SELECT * FROM baz >> MySQL; >> } >> } >> >> As you can see, the heredoc breaks the reading flow completely. For > > The closing marker of the heredoc may be indented as of PHP 7.3, so the > appropriate comparison would be this: > > > class Foo > { > public function __construct( > private \PDO $dbConnection > ) {} > > public function bar() > { > $query =3D << SELECT * > FROM baz > MySQL; > $statement =3D $this->dbConnection->prepare($query); > $statement->execute(); > } > } Pff, that's the second time today 3v4l gives me complete faulty results in its syntax checker. Guess it's out of date. Thanks for correcting me here. Olle