Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42277 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48227 invoked from network); 16 Dec 2008 04:58:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Dec 2008 04:58:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=mark@hell.ne.jp; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mark@hell.ne.jp; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hell.ne.jp designates 84.96.92.121 as permitted sender) X-PHP-List-Original-Sender: mark@hell.ne.jp X-Host-Fingerprint: 84.96.92.121 neuf-infra-smtp-out-sp604006av.neufgp.fr Received: from [84.96.92.121] ([84.96.92.121:57806] helo=neuf-infra-smtp-out-sp604006av.neufgp.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F3/72-30437-E7537494 for ; Mon, 15 Dec 2008 23:58:40 -0500 Received: from neuf-infra-smtp-out-sp604001av.neufgp.fr ([10.110.56.120]) by neuf-infra-smtp-out-sp604006av.neufgp.fr with neuf telecom id rgns1a0022bdnoS06gybcW; Tue, 16 Dec 2008 05:58:35 +0100 Received: from [192.168.0.25] ([77.207.3.30]) by neuf-infra-smtp-out-sp604001av.neufgp.fr with neuf telecom id rgyb1a0040erKVH01gyb35; Tue, 16 Dec 2008 05:58:36 +0100 To: PHP Developers Mailing List In-Reply-To: References: <494698D3.2030801@lerdorf.com> <7977336F527D4A70B0E4DD2870708686@VEGA> <98b8086f0812151310v29603f68kafdb168c6c4e94e9@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Date: Tue, 16 Dec 2008 05:58:34 +0100 Message-ID: <1229403515.27626.3.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] json_encode() From: mark@hell.ne.jp (Mark Karpeles) Hi, I believe part of the job should be the programmer's job too. json_encode() is way too useful to pass things to javascript (the other way around is not that easy, but I have a function called "JSparse" which work nicely with .toSource() output, and an implementation of .toSource() for MSIE, I was doing json with that even before json existed). I'm in favour of #1. Lazy mode is "not that good", as it's going to break things anyway by silently doing magic stuff the final developer didn't expect because it didn't happen in previous versions. Mark Le lundi 15 décembre 2008 à 14:34 -0800, mike a écrit : > On Mon, Dec 15, 2008 at 1:43 PM, John Carter -X (johncart - PolicyApp > Ltd at Cisco) wrote: > > How about a strict mode added to the list of the current json_encode() > > options? > > > > That way current code will continue to work and anyone reading the docs > > will know the default behaviour isn't strictly correct. > > I'd rather have a "lazy mode" option, so by default it is spitting out > correct JSON (according to specs) >