Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115234 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21381 invoked from network); 30 Jun 2021 10:32:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jun 2021 10:32:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9FB831804D9 for ; Wed, 30 Jun 2021 03:52:31 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from sender4-op-o11.zoho.com (sender4-op-o11.zoho.com [136.143.188.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 30 Jun 2021 03:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625050348; cv=none; d=zohomail.com; s=zohoarc; b=hB9yQMCnMC/hwAwF4zUNlaApVAIjKYVenaXQSd9FlYEupuYOc3Zi45usJVPenrYGcOzX1d6SjccvWriQ+dGnx486R4w5Vj6x+iqhjjacOQgDiC2bXnOaq85PRAGULLwqgx7aiaVvSTgqWminCUNHozhrHY/7tu/EUf60Qu+gg3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625050348; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=5gzuEWWALFxuPpdvysPPNGx5mZRs2dWkXmMMwohHrJ8=; b=VQ+iog/pkKvNsD+jS1X+Ce5yIIlbAyDwLIOgeh28xZAIeQDf1ibC/GJkSAu1kx7LRreze1TwIoFtUVGQz29PXmNq5aoGLiBqueOw3JwwYbW44lJB6ZWBzOTkV70oPdFnyjWm7HZNOPfBPFrKkhziviQaDaAHrqdql2O+v5GiZPM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=manuelcanga.dev; spf=pass smtp.mailfrom=php@manuelcanga.dev; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1625050348; s=zoho; d=manuelcanga.dev; i=php@manuelcanga.dev; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=5gzuEWWALFxuPpdvysPPNGx5mZRs2dWkXmMMwohHrJ8=; b=JQWNpybrIv1h6cjC4ruqULEtjK7rka27H44zcJsvOVlvJ9X1Lb3NzQ0dDumdX0+Q c0K89h8aPcNDf7UFS66oZBUaDYixWZc+zL/qDddfKHB5jy9BcCtTQMztfwDhZ3T5L4j iw9WWuwYXF44iiG1NSszDIIwX6pYteDnXNm2tUCA= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1625050316963852.6549285335618; Wed, 30 Jun 2021 03:51:56 -0700 (PDT) Date: Wed, 30 Jun 2021 12:51:56 +0200 To: "Guilliam Xavier" Cc: "Internals" Message-ID: <17a5c8b2f41.12a6d7a4d57462.368224063523322555@manuelcanga.dev> In-Reply-To: References: <17a588d53cc.f512f451993137.1114693900572862097@manuelcanga.dev> <17a59fe12e6.bbd740bb1055351.7212410057372869791@manuelcanga.dev> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Subject: Re: [PHP-DEV] [RFC] Alternative syntax for Nowdoc. From: php@manuelcanga.dev (Manuel Canga) ---- 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 javascript > > only a backtick is used: > > https://developers.google.com/web/updates/2015/01/ES6-Template-Strings= . > > But in PHP this is used as eval. > > >=20 > Just a precision, because you keep referring to it as "eval", which make= s > me "tick" (haha): `$cmd` (i.e. $cmd wrapped in a pair of backticks) is t= he > same as shell_exec($cmd), not eval($cmd). Yes, you're right.=20 =20 > (BTW, one of JS "template strings" main selling points is string > substitution / variable interpolation, which is explicitly *not* wanted > with nowdoc [VS heredoc].) Yes, I mean that in JS is used some similar (although as you say with varia= bles). I would prefer to use this "feature" with nowdoc. Normally, strings with va= riables are moved to views, while large literals (like queries) are added i= nline. =20 > As for the proposal, overall I agree with Rowan -- well, that would not = be > exactly like single quotes (regarding [not] escaping them), but still "y= et > another way" to write a nowdoc string literal. I see this purpose as a simplification of Nowdocs. Just like `[]` with `arr= ay()`. =20 > PS: "amusingly", the code samples are hard to understand after rendered = 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