Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74693 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89210 invoked from network); 2 Jun 2014 08:55:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jun 2014 08:55:29 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.50 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.192.50 mail-qg0-f50.google.com Received: from [209.85.192.50] ([209.85.192.50:36729] helo=mail-qg0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/7B-15017-EFB3C835 for ; Mon, 02 Jun 2014 04:55:27 -0400 Received: by mail-qg0-f50.google.com with SMTP id z60so10314728qgd.9 for ; Mon, 02 Jun 2014 01:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fj63+hRLJ0Yt/GRBcmSo01augBj/FjVHQs1VrLGPo+c=; b=pnd03HxIH66AP3xTsSTke7cb3UT7xKNlkIqVlMcVJLeIKBycb/uYdeDXyNmriC5J4f imCR/QyXmpUkpfBMRORCi4ZUPwXQLuCkvGQZCWv4TlRJOb40tcDbsNO2M70B6psY93td PnwUyAtHaJ5H1rT7QLPTBMigN6KA8vpJ2cgbW7nBqfoj/kHM7gr8MCsB59Vc+otyWCiW sE0+34OGKo+HhdFwr48tQZBvGvbB873DEV/8k6+bR+sve2GodrVqQ3WBYjSBKHPRjkGP /Ec5H464UMSXXK7QZrT6OR8ro2RrxCXaFkStK+3LIY0G7ihY/44pQrcNLu5aeGWv9nlf ibFQ== MIME-Version: 1.0 X-Received: by 10.140.81.74 with SMTP id e68mr43551500qgd.77.1401699324478; Mon, 02 Jun 2014 01:55:24 -0700 (PDT) Received: by 10.140.17.77 with HTTP; Mon, 2 Jun 2014 01:55:24 -0700 (PDT) In-Reply-To: <2F19394F-C75C-40E8-94C3-507FAA9ADE28@ajf.me> References: <6E3D6B3F-1BD6-42A2-B59C-12B9D6D597ED@ajf.me> <538B6D49.3030402@sugarcrm.com> <2F19394F-C75C-40E8-94C3-507FAA9ADE28@ajf.me> Date: Mon, 2 Jun 2014 10:55:24 +0200 Message-ID: To: Andrea Faulds Cc: Stas Malyshev , PHP internals Content-Type: multipart/alternative; boundary=001a11c11d12514bf404fad68e4c Subject: Re: [PHP-DEV] [RFC] Bare Name Array From: tyra3l@gmail.com (Ferenc Kovacs) --001a11c11d12514bf404fad68e4c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, Jun 1, 2014 at 8:37 PM, Andrea Faulds wrote: > > On 1 Jun 2014, at 19:13, Stas Malyshev wrote: > > > You can already do stringKey =3D> 3 :) > > Yes, but then you=E2=80=99ll get: > Notice: Use of undefined constant stringKey - assumed 'stringKey' > in Command line code on line 1 > > > And saving characters is not really > > a big priority. > > Well, we already replaced array() with []. I think it is reasonable to > consider saving characters in other places. It=E2=80=99s not a *big* prio= rity, no, > and we shouldn=E2=80=99t do it excessively, but if common cases are cumbe= rsome, we > should try to deal with them. > > Array literals with string keys and dereferencing arrays with string keys > are extremely common in PHP. So I think this reduction would benefit most > users, especially those who deal with JSON and the like (which I do a lot > in my on code), as this makes declaring arrays to be serialised more > convenient. Also, foobar: just looks nicer than =E2=80=9Cfoobar=E2=80=9D = =3D>, especially > when you have syntax highlighting. > > originally JSON(or what it ended up as JSON) didn't require the keys to be quoted, but it didn't took too long to bump into a reserved keyword and realize that it is better to require the keys to be quoted: https://www.youtube.com/watch?v=3D-C-JoyNuQJs#3m30s --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a11c11d12514bf404fad68e4c--