Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115236 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25156 invoked from network); 30 Jun 2021 10:51:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jun 2021 10:51:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3CEAF18053C for ; Wed, 30 Jun 2021 04:12:01 -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 autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 30 Jun 2021 04:12:00 -0700 (PDT) Received: by mail-vs1-f51.google.com with SMTP id 68so1437111vsu.6 for ; Wed, 30 Jun 2021 04:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dOQEt8e8fYLLkp4HBZfKUhxtkVsCXA471PANgQZcpCQ=; b=doYI1AqMqgQ3fVhbVjF9T4XoynOMls1kUrbpqo2gvuz0tYUZ11MUzbtnceH9G6+M6z dwdETRyJXiymQF4e8dWiz40SOhagxiJLg8rCaKjp1+v4JWj62TN/iimZ3I9ZdZz86vKX VRQqz/va6Zu2JGJS8tUNG4f6YR8Lv+CCqc57TMSSfAGLWsMbK2Zi29sG91/sTQ0oMGoI NwZQTQL10T+ZV3W8agKmOj0nbtzbvWAfJUe+lN0lKwQKUm23FBxkTlOAzLmp28zmMFSN KrsAO0LFfUjAmrsMWUiXq4LgxUdWfzFawhDti80yWwAwSXmgczuIbh/tzmq/s+v2BD5e Kyjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=dOQEt8e8fYLLkp4HBZfKUhxtkVsCXA471PANgQZcpCQ=; b=ft/8gkmK72UKQ54vXGbsJZtR9O0F0d1n7f8F89sHVUR4SrVWDdg5pPrU31ngv/dxib 4IvATpe0bA74/yHV92Y4pGkLc1BFx469ZqHBuOgdPYA/oVUz5145BEHqIsC9sSb0i0ex DGEhbRXlxi1CEMMwj1j3JARbUscPkRT8wKUdsIoiK4TQdvxRCeIDtvKa6bOb9LKBAJB5 wCk2RiNZ88Cr3L/GuvR8bCHluBqVkyTRmJwnqTBjBR6AwDVsmEYrRDzzUEAaEr5ybTYz QOvwzeAaxAWC/NyCp4tGrmbnsqOiStbhQayARmTlQQp8rJljc9ZkuWPjp4NHqMmo2dPQ YUyA== X-Gm-Message-State: AOAM530umphMbwnkwGB8Akqwn9ILERcAYjAORJE+ZGNKu+P8keFNngwl ih8kOiaafma692Zz4oVL6AMoaorctnr1AkioMHYxxJub1JY= X-Google-Smtp-Source: ABdhPJzedz7R7FsOlymL4YNrLBPEEynF1bEgUZ/gyMWesum4NwTHScAYSbUX+3ZNqIF38e2650swhvbPcPMO9G0NjL8= X-Received: by 2002:a67:d010:: with SMTP id r16mr23058391vsi.43.1625051520047; Wed, 30 Jun 2021 04:12:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:6342:0:0:0:0:0 with HTTP; Wed, 30 Jun 2021 04:11:59 -0700 (PDT) In-Reply-To: <17a5c8b2f41.12a6d7a4d57462.368224063523322555@manuelcanga.dev> References: <17a588d53cc.f512f451993137.1114693900572862097@manuelcanga.dev> <17a59fe12e6.bbd740bb1055351.7212410057372869791@manuelcanga.dev> <17a5c8b2f41.12a6d7a4d57462.368224063523322555@manuelcanga.dev> Date: Wed, 30 Jun 2021 16:11:59 +0500 Message-ID: To: Manuel Canga Cc: Guilliam Xavier , Internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Alternative syntax for Nowdoc. From: office.hamzaahmad@gmail.com (Hamza Ahmad) Hi Manuel, If I am not wrong, is not your proposal similar to python's triple-quoted? It is confusing; don't do this. Instead, current syntax are sufficient. Second, (`) have special meaning in PHP. It is used to execute commands on a machine. Why do we have confusing syntax? Best Hamza Ahmad On 6/30/21, Manuel Canga wrote: > ---- En mi=C3=A9, 30 jun 2021 11:03:32 +0200 Guilliam Xavier > escribi=C3=B3 ---- > > Hi, > > Hi Guilliam > > > Maybe other syntax could be used, but I don't know which. In javascrip= t > > > only a backtick is used: > > > https://developers.google.com/web/updates/2015/01/ES6-Template-Strin= gs > . > > > But in PHP this is used as eval. > > > > > > > Just a precision, because you keep referring to it as "eval", which > makes > > me "tick" (haha): `$cmd` (i.e. $cmd wrapped in a pair of backticks) is > the > > same as shell_exec($cmd), not eval($cmd). > > Yes, you're right. > > > (BTW, one of JS "template strings" main selling points is string > > substitution / variable interpolation, which is explicitly *not* wante= d > > with nowdoc [VS heredoc].) > > Yes, I mean that in JS is used some similar (although as you say with > variables). > I would prefer to use this "feature" with nowdoc. Normally, strings with > variables are moved to views, while large literals (like queries) are add= ed > inline. > > > As for the proposal, overall I agree with Rowan -- well, that would no= t > be > > exactly like single quotes (regarding [not] escaping them), but still > "yet > > another way" to write a nowdoc string literal. > > I see this purpose as a simplification of Nowdocs. Just like `[]` with > `array()`. > > > PS: "amusingly", the code samples are hard to understand after rendere= d > on > > https://externals.io/message/115213 > > ups!, I'm sorry...but, look at: > https://externals.io/message/115213#115222 > Markdown is not broken here due to ``` of code. > > Regards, > Manuel Canga > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > >