Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52730 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68550 invoked from network); 1 Jun 2011 23:28:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2011 23:28:13 -0000 Authentication-Results: pb1.pair.com header.from=johncrenshaw@priacta.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=johncrenshaw@priacta.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain priacta.com designates 64.95.72.238 as permitted sender) X-PHP-List-Original-Sender: johncrenshaw@priacta.com X-Host-Fingerprint: 64.95.72.238 mx1.myoutlookonline.com Received: from [64.95.72.238] ([64.95.72.238:7243] helo=mx1.myoutlookonline.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/7B-32367-B0BC6ED4 for ; Wed, 01 Jun 2011 19:28:12 -0400 Received: from st21.mx1.myoutlookonline.com (localhost [127.0.0.1]) by mx1.myoutlookonline.com (Postfix) with ESMTP id 827805532FD for ; Wed, 1 Jun 2011 19:28:09 -0400 (EDT) X-Virus-Scanned: by SpamTitan at mail.lan Received: from HUB023.mail.lan (unknown [10.110.2.1]) by mx1.myoutlookonline.com (Postfix) with ESMTP id EC788553284 for ; Wed, 1 Jun 2011 19:28:08 -0400 (EDT) Received: from MAILR001.mail.lan ([192.168.1.2]) by HUB023.mail.lan ([10.110.17.23]) with mapi; Wed, 1 Jun 2011 19:27:05 -0400 To: PHP internals Date: Wed, 1 Jun 2011 19:28:02 -0400 Thread-Topic: [PHP-DEV] RFC: Short syntax for Arrays (redux) Thread-Index: AcwgrnztPHioCKqzSQWaLYwTCl45uQAA3Tzg Message-ID: References: <4DE5368A.6050603@moonspot.net> <8BEEEE49-8DA3-4634-BF9C-120F7A15B613@roshambo.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] RFC: Short syntax for Arrays (redux) From: johncrenshaw@priacta.com (John Crenshaw) I don't think anyone cares about JSON for the sake of being perfect JSON, I= didn't intend to give that impression. I'm only hoping for something that = generally works on par with all the other JSON parsers in the world. In oth= er words something with roughly the same syntax, constraints, and flexibili= ty as the average browser based JavaScript implementation. Making JSON some= special totally separate object type would totally miss the point and mean= ing of any developer writing such code. Yes, JSON is a very specific encodi= ng, but when a developer writes something "jsony", what they mean is "an ob= ject/array with the following structure/values", because that is what the e= ncoding really represents. John Crenshaw Priacta, Inc. -----Original Message----- From: dukeofgaming [mailto:dukeofgaming@gmail.com]=20 Sent: Wednesday, June 01, 2011 6:52 PM To: Michael Shadle Cc: Sean Coates; Anthony Ferrara; PHP internals Subject: Re: [PHP-DEV] RFC: Short syntax for Arrays (redux) I still don't get it, the idea of making it look like json wont make it json, it will be PHP, and if you dare to write you "jsony" object/array wit= h single quoted strings wont break the code even when its not JSON. I'll say it again: not even Javascript supports 100% valid JSON. I'll say i= t even more times: Not even Javascript supports 100% valid JSON Not even Javascript supports 100% valid JSON Not even Javascript supports 100% valid JSON Not even Javascript supports 100% valid JSON Not even Javascript supports 100% valid JSON JSON even has its own mime type. The idea of JSON as a first-class citizen is a fallacy IMHO. The concept itsel is not ugly, but for god's sake, lets put it in a separate RFC and lets decide con the actual RFC. Perhaps the JSON idea could benefit from autoboxing and a native class?: https://wiki.php.net/rfc/autoboxing JSON is a serializarion format, not a data structure, you coud write an associative array and if PHP knew the way, it could be autointerpreted as JSON, no need to make PHP code look like JSON. I think that the *BEHAVIOR* of arrays/objects as JSON and without the intervention of serialization functions should be in a separate RFC. There is really no point to make PHP *look* like JSON to handle JSON natively . This JSON matter and short array/object syntax are different issues just th= e way "