Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53062 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40937 invoked from network); 6 Jun 2011 18:03:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 18:03:28 -0000 X-Host-Fingerprint: 208.107.178.23 host-23-178-107-208.midco.net Date: Mon, 06 Jun 2011 14:03:28 -0400 Received: from [208.107.178.23] ([208.107.178.23:27401] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 80/C8-23189-F661DED4 for ; Mon, 06 Jun 2011 14:03:28 -0400 Message-ID: <80.C8.23189.F661DED4@pb1.pair.com> To: internals@lists.php.net References: <4DE5368A.6050603@moonspot.net> <8BEEEE49-8DA3-4634-BF9C-120F7A15B613@roshambo.org> User-Agent: slrn/pre1.0.0-18 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit X-Posted-By: 208.107.178.23 Subject: Re: [PHP-DEV] RFC: Short syntax for Arrays (redux) From: weierophinney@php.net (Matthew Weier O'Phinney) On 2011-06-01, Sean Coates wrote: > > Now, the only reason I would personally support the array shortcut is > > if it was an implementation of JSON. I know that's not on the table > > here > > I don't think anything is officially off the table, unless we forego > discussion. > > My application is largely JSON-powered. We pass data from back- to > front-end via JSON, we interact with MongoDB via the extension (which > is an altered JSON-like protocol (arrays instead of objects), but > would be a lot more fluent with actual objects—they're just too hard > to make in current PHP), and we interface with ElasticSearch. The > paste I linked earlier is our primary ElasticSearch query. > > The benefits of first-class JSON are important and wide-reaching; > especially when interacting with systems like the ones I've mentioned. > There's a huge amount of value in being able to copy JSON out of PHP > and into e.g. CURL to make a query to ElasticSearch without worrying > that I've accidentally nested one level too deep or shallow, or > accidentally mistranslating my arrays into JSON. > > This is not about saving five characters every time I type array(), > it's about making my systems all work together in a way that's a > little less abstracted, and a lot less prone to error. *applause* Well, said, Sean. Basically, this discussion should be likened to adding SimpleXML to PHP -- providing tools that make interoperability with other systems or languages simpler. -- Matthew Weier O'Phinney Project Lead | matthew@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc