Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53061 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40858 invoked from network); 6 Jun 2011 18:03:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 18:03:25 -0000 X-Host-Fingerprint: 208.107.178.23 host-23-178-107-208.midco.net Date: Mon, 06 Jun 2011 14:03:24 -0400 Received: from [208.107.178.23] ([208.107.178.23:12861] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/C8-23189-C661DED4 for ; Mon, 06 Jun 2011 14:03:24 -0400 Message-ID: <50.C8.23189.C661DED4@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) 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, Michael Shadle wrote: > On Wed, Jun 1, 2011 at 3:09 PM, Sean Coates wrote: > >> 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. > > Why not make your data in JSON and then $foo = json_encode($data) ? > > Why try to adopt JSON to PHP, just so it matches another language's > format? > > You do realize adding JavaScript syntax for arrays will only make that > consistent with JavaScript, otherwise you're still coding PHP with PHP > syntax, functions, etc. for everything else. That argument seems moot. > If you're more comfortable with JavaScript, start developing in node > if that is your cup of tea. JavaScript is not the only target here. Many, many APIs are utilizing JSON either internally or as the mechanism for communication with other systems. Additionally, have you worked with complex data structures, and attempted to de/serialize to/from PHP? ext/json does fairly well, but there are many places where it fails, and many gotchas to consider to ensure things are serialized correctly. -- 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