Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81394 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36263 invoked from network); 29 Jan 2015 23:51:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2015 23:51:20 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.216.173 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.216.173 mail-qc0-f173.google.com Received: from [209.85.216.173] ([209.85.216.173:44916] helo=mail-qc0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/73-16616-677CAC45 for ; Thu, 29 Jan 2015 18:51:19 -0500 Received: by mail-qc0-f173.google.com with SMTP id m20so18043612qcx.4 for ; Thu, 29 Jan 2015 15:51:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=OL3zDfL8O5lnHpi5w+80oVvgzNgZzUPKrBRkd+2Ib8I=; b=AYxFKSHahW7Q0TMSg3Nv/GV31HaQ6J2cWt1DvZ8JuBASbrCdQF8MhaiH63oWxkrLZP 3p9x0TQ0V1C3J1l9d6EU+92n7usBiu5LGF9Yvfl9R8kOHFmXzQ3RMH9adt8U6K1sZH1+ t91ROpRZjKjQ1NYOJF+WwlTmNNNhgkY7B15677qPw6J1Yj/ZHN/pu2QThVKm8xJaocPf QaZaCF5V0uD0Zbwpv5FNTy7erCfuA7mDly7xn7hAF11QEKMeWauGdKpePRXJpkefkUOz 24lWFxrjtEfdSuEIXmomvQMItfeXbieXNHGUMIIYGCFkpg+k4VhBB+To66vyydoZKTQZ E57Q== X-Gm-Message-State: ALoCoQnvfntKQ0N0r9GWx1KUrZ5wZQq6ZZKok4PBbpGxscBhV5dT1xNeCQ0z1MP3yxFCiQXHAT28 X-Received: by 10.224.43.10 with SMTP id u10mr6942483qae.20.1422575475423; Thu, 29 Jan 2015 15:51:15 -0800 (PST) Received: from [192.168.200.14] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id l10sm8458968qay.22.2015.01.29.15.51.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jan 2015 15:51:14 -0800 (PST) Message-ID: <54CAC771.3050800@lerdorf.com> Date: Thu, 29 Jan 2015 15:51:13 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Yasuo Ohgaki , "internals@lists.php.net" References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b8GOl9TntTGm7wptWNDtSLgDu6gHfRDQe" Subject: Re: [PHP-DEV] Use of {} with member. From: rasmus@lerdorf.com (Rasmus Lerdorf) --b8GOl9TntTGm7wptWNDtSLgDu6gHfRDQe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/29/2015 01:32 PM, Yasuo Ohgaki wrote: > Hi all, >=20 > I came across with bug #68947 https://bugs.php.net/bug.php?id=3D68947 > and realized small inconsistency. >=20 > http://3v4l.org/ldZKl >=20 > $obj->${array[$key]}; // Syntax error > $obj->{$array[$key]}; // Works >=20 > $obj->${key}; // E_NOTICE. Does not work > $obj->{$key}; // Works >=20 > echo "${array[$key]}"; // Works > echo "{$array[$key]}"; // Works >=20 > Of course, script/string parsing aren't the same. Are there technical > reasons > why ${value} is not allowed? If there are, we may encourage >=20 > echo "{$array[$key]}"; // Works >=20 > rather than >=20 > echo "${array[$key]}"; // Works That all seems expected to me. The original point of that bug report is the BC break due to the uniform variable rfc. The change makes sense, but just for the record, I have installed about 10 popular, and a couple of not-so-popular, PHP apps and tested them on PHP 7 over the past week and this was the only BC break that affected that set of 10 apps. See: https://github.com/rlerdorf/avalon/commit/18847d0fe65381977397271c79e04dd= e72ef86f8 It is listed as a bullet point in a sea of other bullet points in the UPGRADING file: . Indirect variable, property and method references are now interpreted with left-to-right semantics. See details in: https://wiki.php.net/rfc/uniform_variable_syntax#semantic_differences_in_= existing_syntax But we probably need a section devoted to BC breaks that includes some real-world code examples. -Rasmus --b8GOl9TntTGm7wptWNDtSLgDu6gHfRDQe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTKx3EACgkQlxayKTuqOuD5dQCggLY8PKz6MwKHCJiiJupUC64Q CPIAn25mr8rgC7TzpsATFRFthWfpEDQI =NY6s -----END PGP SIGNATURE----- --b8GOl9TntTGm7wptWNDtSLgDu6gHfRDQe--