Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42249 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98624 invoked from network); 14 Dec 2008 08:39:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Dec 2008 08:39:52 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 204.11.219.139 mail.lerdorf.com Received: from [204.11.219.139] ([204.11.219.139:50146] helo=mail.lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/D5-47862-656C4494 for ; Sun, 14 Dec 2008 03:39:51 -0500 Received: from [216.145.54.15] (socks3.corp.yahoo.com [216.145.54.15]) (authenticated bits=0) by mail.lerdorf.com (8.14.3/8.14.3/Debian-6) with ESMTP id mBE8djI7027150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 14 Dec 2008 00:39:46 -0800 Message-ID: <4944C651.1090801@lerdorf.com> Date: Sun, 14 Dec 2008 00:39:45 -0800 User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: mike CC: "moo.tinys" , Stan Vassilev | FM , PHP Developers Mailing List References: <2D85B33E-889B-4214-9BB8-A12EFFFC641E@macvicar.net> <1229150500.30719.201.camel@localhost> <4BA26FE8A9634178B4CEBEFA818810D2@VEGA> <15E310EAB433466EAF996B252CBED2BB@pc> <49448D66.2030501@lerdorf.com> <28139bc0812132210p1ed94f4ds40e31ff499cf2e7@mail.gmail.com> <7463F1E1-A880-479F-9584-30FFCED6E614@gmail.com> <4944AA37.9030400@lerdorf.com> <234C8048-A00D-4AEE-A23E-5FA10EA85D6D@gmail.com> <4944AD36.7070406@lerdorf.com> <6C9F85B0-29B8-419C-8DD1-BA90135214D3@gmail.com> In-Reply-To: <6C9F85B0-29B8-419C-8DD1-BA90135214D3@gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Removing basic types from our JSON parser From: rasmus@lerdorf.com (Rasmus Lerdorf) mike wrote: > Do you mean a json_parse in javascript (like a better eval() I assume)? > Thats what we were doing. Json is not supposed to be pure javascript > either, but a serialized representation of variables like php's > serialize(). So I would not expect a json string to be usable without > using eval or something else in javascript first. We had to modify the > php json_encode output to be wrapped with a couple extra braces for it > to be able to be consumed properly on javascript (or maybe it was the > other way around) - I just want to make sure we won't have to make > special things like that in the future. Eh? Read what you wrote there. If json wasn't pure javascript, how in the world would eval() work on it? Douglas Crockford likes to say that he didn't invent json, he discovered it. It was already there because it is just javascript. He just started using it. will always work. The only question is what sort of variable foo will end up being. The RFC says we have to wrap basic types in an array or object, while currently we let the basic types through without the wrapper. -Rasmus