Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43312 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34210 invoked from network); 11 Mar 2009 19:25:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2009 19:25:20 -0000 Authentication-Results: pb1.pair.com header.from=christopher.oestlund@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=christopher.oestlund@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.158 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: christopher.oestlund@gmail.com X-Host-Fingerprint: 209.85.220.158 mail-fx0-f158.google.com Received: from [209.85.220.158] ([209.85.220.158:34444] helo=mail-fx0-f158.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/55-09289-D1018B94 for ; Wed, 11 Mar 2009 14:25:18 -0500 Received: by fxm2 with SMTP id 2so131548fxm.23 for ; Wed, 11 Mar 2009 12:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=EgVPjsOkCWs8dGy8tz/GiY2bdJaRIjspiTgy62GFBD4=; b=R3mObMuUtomH8uTe7fjkqlPcV4JDin47lwPyzvdAOIptU36sDuKB3MqpI5CLKJ8tAz SY2LiiAPKvcd6U534dS/PnJIlU6DuGZK3NEIevRMuhtfLlN3ETusmEn+u3lu67yL664p whzIH0U7mKb8DpTqhBm+zmTNpk+aIkYHpAJJA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=GrNklMCJyEuV2DnxttJM1BvJ6ugINN23b1uOfRlS0AO1I8a++JT3xCFF173ua3TKLL GiD9pjt07jCahxXqG9Oxq9Ho4knShGy8Upm5RhMU/qXzaYWpuQvti8PHw96KGtA1aK0T g4f9nCc5Ci9r4v/RLouVhfqKco0R4bIxyYsjQ= MIME-Version: 1.0 Received: by 10.223.110.200 with SMTP id o8mr6684435fap.56.1236799515047; Wed, 11 Mar 2009 12:25:15 -0700 (PDT) In-Reply-To: <10845a340903100332v32aaa2bbs20316c2aea7738a5@mail.gmail.com> References: <10845a340903020821v718bc762g243864f7e098ee1c@mail.gmail.com> <49AC08EA.5000105@macvicar.net> <10845a340903020836u67ba1600qd4be7101f4256863@mail.gmail.com> <49AC0CB7.6@macvicar.net> <10845a340903100332v32aaa2bbs20316c2aea7738a5@mail.gmail.com> Date: Wed, 11 Mar 2009 20:25:13 +0100 Message-ID: <8f5c52fe0903111225lbbfd07ek7f51c9f1f31877c0@mail.gmail.com> To: PHP Internals List Content-Type: multipart/alternative; boundary=001636c5a9b1c0b7580464dcd34f Subject: Re: [PHP-DEV] Patch and test cases too for From: christopher.oestlund@gmail.com (=?UTF-8?Q?Christopher_=C3=96stlund?=) --001636c5a9b1c0b7580464dcd34f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit I think this behavior is a bit odd too: php -r "echo json_encode(array(0=>'test'));" // ["test"] php -r "echo json_encode(array(1=>'test'));" // {"1":"test"} On Tue, Mar 10, 2009 at 11:32 AM, Richard Quadling wrote: > 2009/3/2 Scott MacVicar : > > Richard Quadling wrote: > >> 2009/3/2 Scott MacVicar : > >>> Richard Quadling wrote: > >>>> Hi. > >>>> > >>>> Regarding http://bugs.php.net/bug.php?id=47493, I've supplied a patch > >>>> to the unit tests too. > >>>> > >>>> Any chance this could get committed to 5.2+ > >>>> > >>> I'm too convinced of the parameter name and I don't think its something > >>> that should be added to 5.2.9 since its a feature. > >>> > >>> Scott > >>> > >> > >> 5.3+ would be OK then. > >> > >> As to the param name, I'm not actually changing the name, just adding > >> another flag. > >> > >> In javascript's terminology,the output is an array ... > >> > >> [] > >> > >> or a hash > >> > >> {} > >> > >> So forcing a hash for arrays is pretty much what would be wanted and I > >> as I comment in the request, we have a "force" option when coming FROM > >> json data ... json_decode ( string $json [, bool $assoc= false [, int > >> $depth= 512 ]] ) > >> > >> And the "name" of the param here is appropriate to PHP's use (assoc is > >> not part of JSON's or JS's terminology). > >> > >> If you can think of a better name for the flag, then I'd be glad to use > it. > >> > > > > The JSON spec refers to them as arrays or objects though, as does our > > documentation I believe. > > > > PHP_JSON_FORCE_OBJECT > > > > I however have another patch for more strict encoding so I'll try to > > roll this in a single update. > > > > Scott > > > > First of all, this isn't a "why is this not done yet" message. Honestly. > > Do you have any timeframe for this though? > > Do you think it will be ready for 5.3RC1? > > Thank you, > > Richard Quadling. > > -- > ----- > Richard Quadling > Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 > "Standing on the shoulders of some very clever giants!" > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001636c5a9b1c0b7580464dcd34f--