Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92294 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22331 invoked from network); 14 Apr 2016 10:37:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2016 10:37:11 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.215.44 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.215.44 mail-lf0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:36813] helo=mail-lf0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/68-12455-5D27F075 for ; Thu, 14 Apr 2016 06:37:10 -0400 Received: by mail-lf0-f44.google.com with SMTP id g184so103467066lfb.3 for ; Thu, 14 Apr 2016 03:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daveyshafik-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=Ps8GoC959EP0RI7sn/WFZpneEeIHZe8PURwgXoxjJVk=; b=oNQbsVJCoq4ODEHkxKSja6YDCoHJFq3x6JLGepZ20/ED/Q6qIHhRaFt/neabTo3svO dblyql5q01TLrKY2wNsYjYaSP1wHPnDS9g7MHHhcF6WxyaT3P840wFaMwTHQ/ochDU9p d3ZfxtaII2FinNjd2lDmrdnje46FscTSpMzDKrgUNAZuKmV7c7gACIXIEJauDcRB0mWD xaYyvoUZQyn+ZYqri8jukHxw7uX16ugDXNIxGrVXdffmf0dYHzrJaOI0wushakcjat4W tKTWa2Z9olXdKfrOEV7pXKhNG5c3iSFqQbY76lwu8V7m59ESvU5j2j+pj3WcR34eHCIA YcRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Ps8GoC959EP0RI7sn/WFZpneEeIHZe8PURwgXoxjJVk=; b=ae7DypUmFmCZ3AX2UFkjLi2HOs5RP8g/XVxEcIZqoiUdwXY+JIrwH+z3M6k9IwH38X 7mP6lNT1j5oFdU5h2dfu93Ot75J8uqPpBWX+Cbg9ct9zF7VjXqyQ6chjrlcJGIDvAZf5 LKH8QMCAfofnw3g8JZis07HcL6tCdn1CT3LvC/7pDGkRyiQqTmy6D09ywCwekVK3XXgy d/AAt0sb/2g8s2zC0t9Au2fheY+lTIgbeB3dP/ihZDNnNoGDcrN221e8TttE3dZd8c45 5yjtpnOiHbm+lCdXAi2YRPXxgtOg81AWPCVqXnYPBNSFooO/Zq/HcQIDnezuInUVxEeE kTvA== X-Gm-Message-State: AOPr4FXau0xLb67lk1JNnYCBAY27WvHCBr10JJ0kv+p4x3mQJTgm6OpkqLNZPGBwuLW7tSLjesI3hUt3ddJ37Gdy MIME-Version: 1.0 X-Received: by 10.112.72.199 with SMTP id f7mr6060341lbv.17.1460630226443; Thu, 14 Apr 2016 03:37:06 -0700 (PDT) Sender: me@daveyshafik.com Received: by 10.25.125.196 with HTTP; Thu, 14 Apr 2016 03:37:06 -0700 (PDT) In-Reply-To: References: Date: Thu, 14 Apr 2016 03:37:06 -0700 X-Google-Sender-Auth: Amj_7oHe8BFDpBcq5-xURs0VlK0 Message-ID: To: Sara Golemon Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c24064cbbaa405306f7949 Subject: Re: [PHP-DEV] Interpolation using ${} syntax with spaces inside the braces From: davey@php.net (Davey Shafik) --001a11c24064cbbaa405306f7949 Content-Type: text/plain; charset=UTF-8 Whitespace inside of { } should not matter, the contents should be evaluated as an expression and it's results used to determine the variable name, so ${great} should also be $my as in the other cases. Is this related to the use of quotes around string array keys inside strings? e.g. "$foo[great]" does not evaluate to $foo['my'] but to $foo['great']. - Davey On Tue, Apr 12, 2016 at 8:08 PM, Sara Golemon wrote: > I'm trying to decide just whether or not > https://bugs.php.net/bug.php?id=71927 is "working as intended" as well > as what the expected behavior in this situation /should/ be. > > https://3v4l.org/HfU1g indicates that at the very least HHVM and PHP > disagree on the correct output, and testing the same sort of > expression in bash says that it's not having any of it; "invalid > substitution" warnings abound. > > The PHP behavior is just kinda weird. "${ great}" does constant > interpolation yielding "$my" which in turn becomes variable > interpolation and we find up with "my value". I'm actually doubtful > that PHP pulls off this juggling *by accident*, which is why I'm > posting about it before even going to the extent of proposing an RFC. > > Does anyone have historical context on this and can explain the > current behavior as "working as intended"? > > -Sara > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --001a11c24064cbbaa405306f7949--