Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53058 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33742 invoked from network); 6 Jun 2011 17:18:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 17:18:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=marcel.esser@croscon.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=marcel.esser@croscon.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain croscon.com from 66.46.182.54 cause and error) X-PHP-List-Original-Sender: marcel.esser@croscon.com X-Host-Fingerprint: 66.46.182.54 relay.ihostexchange.net Windows 2000 SP4, XP SP1 Received: from [66.46.182.54] ([66.46.182.54:38988] helo=relay.ihostexchange.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/A7-23189-0DB0DED4 for ; Mon, 06 Jun 2011 13:18:09 -0400 Received: from [192.168.1.120] (76.111.6.201) by smtp.ihostexchange.net (66.46.182.50) with Microsoft SMTP Server (TLS) id 8.3.137.0; Mon, 6 Jun 2011 13:18:06 -0400 To: internals@lists.php.net In-Reply-To: <9C6264DC-C61A-486B-ABB6-C476C3F5B085@seancoates.com> References: <084D2F1E-87E7-44CF-B8B6-47A250AD928D@seancoates.com> <9C6264DC-C61A-486B-ABB6-C476C3F5B085@seancoates.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 6 Jun 2011 13:18:07 -0400 Message-ID: <1307380687.6617.4.camel@pandastation> MIME-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Object and Array Literals From: marcel.esser@croscon.com (Marcel Esser) On Mon, 2011-06-06 at 13:10 -0400, Sean Coates wrote: > > Please add the RFC header so we know what's the status. > > Thanks for catching this. > > >> $a = ['one': 1, 'two': 2, 'three': 'three']; > > > > has anyone played with the parser to > > implement it? > > I have not, personally. I feel like it would be a waste of time at this point, unless a logical problem can be identified. > > > Also the : syntax was not the preferred one either in > > the short syntax RFC. > > This RFC is a superset of the short array syntax RFC, in my opinion. > > > About the anonymous objects, the usage of stdclass is rare, at least > > for the ones I met or use. > > We use it a lot. This grep is from the root of the Gimme Bar code (my work project): > > $ grep -ir 'StdClass' * | wc -l > 229 > > > A last comment for the record here, this whole JSON-like syntax sounds > > wrong to me from the beginning. JSON does not aim to be written or > > read by human being. It is about exchanging data between two ends. I > > don't think using it as a base for a syntax in a language is a good > > thing to do. > > You've just stated that you don't use this sort of thing very often (which is fine, but users who don't use this very often are not my intended target audience for this RFC). > > In my experience, users who DO interact with systems that speak JSON (or a JSON-like syntax) find this very useful, and have been wanting it for a long time. I have anecdotal evidence of this, but I could draw up something more concrete if that's what is required to get this to pass. > > S > > While I would have been happy with the short array syntax proposed earlier, I do have to say that Sean's points make a lot of sense to me and I am strongly inclined to agree with him. I can't really see any harm in this superset compared to the previous; it seems to me like it would just make a lot of things handier. - M. -- Marcel Esser VP/Engineering, CROSCON Washington, D.C. Office @: marcel.esser@croscon.com office.us +1 (202) 470-6090 mobile.us +1 (202) 250-1988 mobile.de +49 (0)176 391 226 23