Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73134 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4774 invoked from network); 13 Mar 2014 22:37:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2014 22:37:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=marco@m-s-d.eu; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=marco@m-s-d.eu; sender-id=unknown Received-SPF: error (pb1.pair.com: domain m-s-d.eu from 209.85.223.173 cause and error) X-PHP-List-Original-Sender: marco@m-s-d.eu X-Host-Fingerprint: 209.85.223.173 mail-ie0-f173.google.com Received: from [209.85.223.173] ([209.85.223.173:52078] helo=mail-ie0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/AA-47923-54332235 for ; Thu, 13 Mar 2014 17:37:58 -0500 Received: by mail-ie0-f173.google.com with SMTP id rl12so1771320iec.18 for ; Thu, 13 Mar 2014 15:37:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=B0yXfLB6o9ee4LayFzeH2BZ5+p1WU2LG9UaDKteupGM=; b=lsQtikMH+jyFU4GhVNp9M++uPAlCFj6ETWcjZTnH3iD4WIxPeLz1lcgwi+yoJmvW41 sf90gJOkq93mRUWmv7dLWnoWl6o2mjlSTEUq4t6hhZnexSgSrpEeQ57ptQIyzwFi3jQ6 9lvzEgxn87Sd7vWjxuaJJPpC9o/UAHZ8i5/Y8xjZaoCN6OJMWOuM+aPQXus7AwM01630 MOtGAb1Vc2moLndp3srRsOgnH9EVMxsEC6GA8sxAjZq5M3/bn7Mt+NovtSDRYrxkIa0u tpQ3gy1W/BRtgLwW36lTGbPct7ZukfkyRx1FjJaaDdvH7Zi9G7LRkqA2NU4IWk7kaeox lK7Q== X-Gm-Message-State: ALoCoQn03w5NeHNneJaNQi4V+/i7likm7A2m1H2EFuZ3ChzNYyzGH9Tsf3g/c9jKEBsmpTfEe9R5 MIME-Version: 1.0 X-Received: by 10.50.25.138 with SMTP id c10mr4389122igg.15.1394750274192; Thu, 13 Mar 2014 15:37:54 -0700 (PDT) Sender: marco@m-s-d.eu Received: by 10.64.165.166 with HTTP; Thu, 13 Mar 2014 15:37:54 -0700 (PDT) X-Originating-IP: [46.128.155.165] In-Reply-To: References: Date: Thu, 13 Mar 2014 23:37:54 +0100 X-Google-Sender-Auth: U2_kmx97YxUdDoNOAJ8pXE3bP9Q Message-ID: To: Jakub Zelenka Cc: PHP internals list Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] New JSON parser From: marco+php@m-s-d.eu (Marco Schuster) Hi, On Thu, Mar 13, 2014 at 8:48 PM, Jakub Zelenka wrote: > I need to do more testing before creating RFC for replacing the current > parser. There is still space for further improvements. If anyone has any > ideas, please let me know. Or if you could test it, that would be great > too! ;) At least for the decoding part, it might be worth to look at the "Improving JSON" proposal (http://bolinfest.com/essays/json.html). tl;dr: support trailing or automatic line-end commas, //-style comments and keys not wrapped in "s, basically extend JSON syntax to ES5. I think it would be really cool if the new parser could (maybe with a option "JSON_NO_STRICT_PARSING") implement these enhancements to ease hand-writing of JSON files. Also, will end-users be able to get the JSON parser error message? Currently, all you get is a NULL returned when you have a parse error somewhere in your JSON - and it's a nightmare to debug with this. Marco