Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99842 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 175 invoked from network); 11 Jul 2017 19:09:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2017 19:09:53 -0000 Authentication-Results: pb1.pair.com header.from=ilija.tovilo@me.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ilija.tovilo@me.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain me.com designates 17.142.194.251 as permitted sender) X-PHP-List-Original-Sender: ilija.tovilo@me.com X-Host-Fingerprint: 17.142.194.251 pv33p00im-asmtp002.me.com Received: from [17.142.194.251] ([17.142.194.251:31695] helo=pv33p00im-asmtp002.me.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/8A-47109-D7225695 for ; Tue, 11 Jul 2017 15:09:50 -0400 Received: from process-dkim-sign-daemon.pv33p00im-asmtp002.me.com by pv33p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OSX00600WTA3300@pv33p00im-asmtp002.me.com> for internals@lists.php.net; Tue, 11 Jul 2017 19:09:38 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1499800178; bh=N9cFOZLD5U+WsJcMKS7UuOinGOUOX1hOjVRotxwUUW0=; h=Date:From:To:Message-id:Subject:MIME-version:Content-type; b=fJOYKmYQgIWtijrTPsfVfQh2MMIB0Om7fr1OLVi7s1mAEDcGnACcbd4WgygkNZT/B sB71Ll0hTx4/SaJ/O2E0NV/4NkDhY6tkfCuQc6Tw3gEmt1s9oaRw/U4mEcCMMSwfaR CGGwL91FM6QQvImOesO+TOM/CGfHbxidijM0urrym79lxyjG4ctugi9XnWN19Dk7Ll H2QPkvZxBZTbXS/EST5KdSl9K6ssgjLUp+3mHPFBUu8XYfN5N1cKzbpDUOAWbQmWNS u2rRzHqZ1ic9BCCpuLCvGbZslwIBBtGEK6c9P/oFVy/ivI9jS7tBkp2zetLcNf5FzA YRPETO2VtwXsA== Received: from icloud.com ([127.0.0.1]) by pv33p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OSX00JNUX7W0H20@pv33p00im-asmtp002.me.com> for internals@lists.php.net; Tue, 11 Jul 2017 19:09:34 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-11_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=1 spamscore=1 clxscore=1034 suspectscore=32 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1707110309 Date: Tue, 11 Jul 2017 20:41:17 +0200 To: PHP internals Message-ID: <03c18d51-f939-4031-a02e-8e84c44f2f5a@Spark> X-Readdle-Message-ID: 03c18d51-f939-4031-a02e-8e84c44f2f5a@Spark MIME-version: 1.0 Content-type: multipart/alternative; boundary=5965226b_6b8b4567_1579c Subject: String interpolation shortcomings From: ilija.tovilo@me.com --5965226b_6b8b4567_1579c Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi everyone String interpolations are a great feature. They make your code more reada= ble and can reduce the number of allocations PHP has to make. Unfortunately, PHP is very restrictive in what kind of expressions string= interpolation accepts. The only time you can actually use it is if your = expression starts with the =60=24=60 symbol. You cannot use it for: - =46unction calls - Infix expressions - Constants or class constants - Instantiations - Expressions in parentheses Or anything else that doesn=E2=80=99t begin with the =60=24=60 symbol. Even more unfortunate is that =60=24=7Bfoo()=7D=60 is equivalent to =60=7B= =24foo()=7D=60 which means we cannot simply extend the current syntax to = support all expressions. Of course, we could deprecate the =60=24=7Bfoo()= =7D=60 syntax and reintroduce it with a different semantic meaning after = some time but this is far from satisfying. There is also the possibility of introducing new syntax for string interp= olation and deprecating the old one after a transition period (e.g. =60=E2= =80=9DHello =5C(world())=E2=80=9D). Does anyone think this is worth fixing=3F --5965226b_6b8b4567_1579c--