Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52877 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77860 invoked from network); 4 Jun 2011 01:18:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jun 2011 01:18:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=dukeofgaming@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dukeofgaming@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: dukeofgaming@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:53697] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/32-08509-6C789ED4 for ; Fri, 03 Jun 2011 21:18:00 -0400 Received: by yxn35 with SMTP id 35so896911yxn.29 for ; Fri, 03 Jun 2011 18:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=U0e8bwCf/2cbCbCEF2vT3yL5WrFJTo26GT1+8njXTUw=; b=WUfEd6SRZiql6+RN1w3BXygj7oQFRfrqT9TBOx1Ov6TCsCk2Ahtbu69PJF+TDx8TSg 1uh7dypwM0q3tUboxttAFwl/WrswVvfKiC/KPQfaoAd4zejN4BsgvoDS4W32UT0XpfjA z8cj5TTlLyow3z+cJ0RLEa8Z729wQleJSfiZo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=F9iRrkYvf2CM8XtSbGJgu+DQkrlTCQMskK4okUM09NcLZIbtToi0j0HDJHHskTgMC3 2N7Kt8uFEtGMEHLLJaMTq+35p1UIuA397iP1doM9rNoWPGWMMOwkIK0aq7tR0lXPDsaJ Hz6N0rbZUrdp90Pl7zp9Fv3rLEkPlFtVNiRyU= Received: by 10.101.166.1 with SMTP id t1mr1861142ano.43.1307150276094; Fri, 03 Jun 2011 18:17:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.96.15 with HTTP; Fri, 3 Jun 2011 18:17:36 -0700 (PDT) Date: Fri, 3 Jun 2011 20:17:36 -0500 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=005045015be8dfed1504a4d8a3e6 Subject: JSON array/object syntax From: dukeofgaming@gmail.com (dukeofgaming) --005045015be8dfed1504a4d8a3e6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, After reading all the debate in the other thread it is still not clear to m= e what the real advantages are of adopting JSON syntax for native PHP types. Doing json_encode to an object and expect the code and output to be the same seems useless to me, and reading David Z=FClke's example it seems more like a pure-unicode issue to me: ---- It is different from writing json_decode('=E4\u0123'), because json_decode(= ) in PHP only accepts UTF-8 encoded input; Give it a shot: That'll produce: > array(1) { > [0]=3D> > string(4) "=E4=E4" > } > NULL Understand what the problem is now? If someone does this in a latin1-encoded file: Then that is valid as a PHP array (as it's a latin1 "=E4", so \xE4), but cannot be consumed by PHP's json_decode(). And that would be terribly inconsistent behavior. ----- It looks more like you want to do json_decode to PHP code hoping that will somehow fix json_decode... instead of fixing json_decode. Could someone advocating this please explain with use-cases and concrete & punctualized examples the advantages of having such JSON approach to PHP. Regards, David Vega --005045015be8dfed1504a4d8a3e6--