Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42248 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96505 invoked from network); 14 Dec 2008 08:19:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Dec 2008 08:19:17 -0000 Authentication-Results: pb1.pair.com header.from=mike503@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=mike503@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mike503@gmail.com X-Host-Fingerprint: 209.85.198.227 rv-out-0506.google.com Received: from [209.85.198.227] ([209.85.198.227:20050] helo=rv-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/85-47862-481C4494 for ; Sun, 14 Dec 2008 03:19:17 -0500 Received: by rv-out-0506.google.com with SMTP id g37so2225438rvb.23 for ; Sun, 14 Dec 2008 00:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:cc; bh=d+YgTR0pChwtZZj9gssig2NZMRNyxyBOcAbs8cG4PqU=; b=ZpS+IDUO6PT8gYuhOiuQ5+5w6XsPMTkElGFLhjAQXHJM7N2VKIU0OXVLxF/TXv/fHd dbJcmJVn4UJeadwW1CrDmmXnkBgou5ADZpzb44yGfecasrneMmzI60BJ+JqFeQfkUoUC h8NRzavpNyuIfngCzJoQwXyQ++5ZlBPga3OXE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date:cc; b=RBtvtQJBTj640ojnyfn+m9MVUriRTiZ2R8tmM0dSlRadtakEgta7wwT4mdcT9pLZfq eKrPkbzVZM6EaVkfRNn1FyF07WirHOtZCfDnp2ZQ8pLnum9GbaPA918tZnYeiAoYqIU+ 2CrrZESVLQdzr3KrhrbPdwc4ixlrgYjpc+1+w= Received: by 10.141.152.8 with SMTP id e8mr2945376rvo.273.1229242753893; Sun, 14 Dec 2008 00:19:13 -0800 (PST) Received: from ?10.93.144.237? ([32.158.39.35]) by mx.google.com with ESMTPS id b39sm807055rvf.0.2008.12.14.00.19.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 14 Dec 2008 00:19:13 -0800 (PST) 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> Message-ID: <6C9F85B0-29B8-419C-8DD1-BA90135214D3@gmail.com> To: Rasmus Lerdorf In-Reply-To: <4944AD36.7070406@lerdorf.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (5G77) Mime-Version: 1.0 (iPhone Mail 5G77) Date: Sun, 14 Dec 2008 00:18:04 -0800 Cc: "moo.tinys" , Stan Vassilev | FM , PHP Developers Mailing List Subject: Re: [PHP-DEV] Removing basic types from our JSON parser From: mike503@gmail.com (mike) 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. On Dec 13, 2008, at 10:52 PM, Rasmus Lerdorf wrote: > Yes, but that would be going to a json_parse thing somewhere, not pure > Javascript. > > -Rasmus > > mike wrote: >> I can't give specifics (I'm mobile and I don't remember where the >> code >> would be anyway) but we had an issue with php and javascript exchange >> via json where the php output using json_encode and we had to wrap it >> with additional braces for it to be usable. Sorry for being vague, >> this >> thread reminded me of that which is why I wanted to voice off. >> >> Thanks for the clarification (and thank you so much for PHP :)) >> >> On Dec 13, 2008, at 10:39 PM, Rasmus Lerdorf >> wrote: >> >>> mike wrote: >>>> Sorry for top posting. I see no reason why php should not interop >>>> with >>>> javascript 100% as it should. I do not see a reason to create new >>>> functions, parameters, etc. The existing should be expected to both >>>> encode and decode json with javascript properly. If there is a >>>> mismatch >>>> right now, then it should be fixed. >>> >>> There is no mismatch with Javascript now at all. We spit out >>> perfectly >>> valid Javascript. There is only a slight mismatch with the JSON RFC >>> which defines a stricter subset of Javascript than we are using. >>> >>> -Rasmus >