Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52802 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4703 invoked from network); 2 Jun 2011 19:01:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jun 2011 19:01:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=david.zuelke@bitextender.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=david.zuelke@bitextender.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain bitextender.com from 80.237.132.12 cause and error) X-PHP-List-Original-Sender: david.zuelke@bitextender.com X-Host-Fingerprint: 80.237.132.12 wp005.webpack.hosteurope.de Received: from [80.237.132.12] ([80.237.132.12:59050] helo=wp005.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/24-11525-EEDD7ED4 for ; Thu, 02 Jun 2011 15:01:03 -0400 Received: from [82.113.99.20] (helo=[10.55.4.148]); authenticated by wp005.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) id 1QSD8V-0001WL-Bk; Thu, 02 Jun 2011 21:00:58 +0200 References: <4DE5368A.6050603@moonspot.net> <8BEEEE49-8DA3-4634-BF9C-120F7A15B613@roshambo.org> In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8J2) Content-Transfer-Encoding: 7bit Content-Type: multipart/alternative; boundary=Apple-Mail-1-169032683 Message-ID: <4C39B728-2283-49A7-87F5-B0CC9EC42505@bitextender.com> Cc: Sean Coates , Anthony Ferrara , PHP internals X-Mailer: iPhone Mail (8J2) Date: Thu, 2 Jun 2011 21:00:23 +0200 To: Martin Scotta X-bounce-key: webpack.hosteurope.de;david.zuelke@bitextender.com;1307041263;f520ce93; Subject: Re: [PHP-DEV] RFC: Short syntax for Arrays (redux) From: david.zuelke@bitextender.com (=?utf-8?Q?David_Z=C3=BClke?=) --Apple-Mail-1-169032683 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 No we can't; I already explained why in another email last night. Copypasta:= json_decode() can deal with Unicode sequences because decodes to UTF-8. That= is not possible in a language construct: What if I do this, in a latin1 encoded file: $x =3D {foo: "=C3=A4", bar: "\u0123"} Should that then give mixed encodings? The "=C3=A4" in foo in latin1 and the= stuff in bar in UTF-8? And what if I do: $x =3D {foo: "=C3=A4\u0123"} I'll either end up with an invalid UTF-8 sequence, or with latin1 character s= oup. David On 02.06.2011, at 18:04, Martin Scotta wrote: > Could we first go out with fully JSON compatible version for 5.4? > and then later decide the =3D> stuff based on how that worked. >=20 > Native JSON is a big stuff for userland, and I'm pretty sure it will bring= a > hole of core version upgrades. >=20 > Martin Scotta >=20 >=20 > On Wed, Jun 1, 2011 at 7:09 PM, Sean Coates wrote: >=20 >>> 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 >>=20 >> I don't think anything is officially off the table, unless we forego >> discussion. >>=20 >> 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 a= n >> altered JSON-like protocol (arrays instead of objects), but would be a lo= t >> more fluent with actual objects=E2=80=94they're just too hard to make in c= urrent >> PHP), and we interface with ElasticSearch. The paste I linked earlier is o= ur >> primary ElasticSearch query. >>=20 >> 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'v= e >> accidentally nested one level too deep or shallow, or accidentally >> mistranslating my arrays into JSON. >>=20 >> 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. >>=20 >> S >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >>=20 >>=20 --Apple-Mail-1-169032683--