Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43230 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80764 invoked from network); 2 Mar 2009 20:02:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Mar 2009 20:02:58 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.218.180 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 209.85.218.180 mail-bw0-f180.google.com Received: from [209.85.218.180] ([209.85.218.180:38384] helo=mail-bw0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/65-00495-07B3CA94 for ; Mon, 02 Mar 2009 15:02:57 -0500 Received: by bwz28 with SMTP id 28so2184036bwz.23 for ; Mon, 02 Mar 2009 12:02:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=xbL96y6NQcRIhoXxbt/SwPnXM1muXIuyudob5czlRXM=; b=pYw/8GQLiznTV4YmX5UlQZrubcXoFQU8zbQMpU194jNxSZq+YVsdL8C6NEAz67OyXi jG2utbKQTCEbOYvqIyM8egBCA81phC2H1yIVITbVFHkR4mUvbCBqPjyGZYC3y1PSeh3Z J2FEP7Sg0XCY19R1Ks3cMrDH/blMnH9rW08JI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; b=KaX+0huhkNDoWd2tJfBQspvR0musoepy/vC9VWYOxrV0jx27qv78/M4PajgiDN8cXi Ig1JIIw1aRAtz213fYuH63QwbEQJDgafgbx9uABuJ+aGtDKn4bUBHsTbKh5CZs8cS+YH DIV1pb9QRo9oxx0UGreYpT4L+DjSQCjccGPj0= MIME-Version: 1.0 Received: by 10.223.112.130 with SMTP id w2mr6299942fap.65.1236024172285; Mon, 02 Mar 2009 12:02:52 -0800 (PST) Reply-To: RQuadling@googlemail.com In-Reply-To: <49AC0CB7.6@macvicar.net> References: <10845a340903020821v718bc762g243864f7e098ee1c@mail.gmail.com> <49AC08EA.5000105@macvicar.net> <10845a340903020836u67ba1600qd4be7101f4256863@mail.gmail.com> <49AC0CB7.6@macvicar.net> Date: Mon, 2 Mar 2009 20:02:52 +0000 Message-ID: <10845a340903021202o725a4899t453fde062e45c8c@mail.gmail.com> To: Scott MacVicar Cc: PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Patch and test cases too for From: rquadling@googlemail.com (Richard Quadling) 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 > When it is in JSON, it isn't an object, but an object hash, similar, as I understand things, to the differences between a class definition and an instance. Or, I suppose more like an object serialization and an object. PHP_JSON_FORCE_OBJECT would be ideal. Thank you. -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"