Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86571 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60533 invoked from network); 10 Jun 2015 18:02:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2015 18:02:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=ppasindud@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ppasindud@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.179 as permitted sender) X-PHP-List-Original-Sender: ppasindud@gmail.com X-Host-Fingerprint: 209.85.223.179 mail-ie0-f179.google.com Received: from [209.85.223.179] ([209.85.223.179:34270] helo=mail-ie0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/A1-51179-1BB78755 for ; Wed, 10 Jun 2015 14:02:25 -0400 Received: by iebmu5 with SMTP id mu5so39783548ieb.1 for ; Wed, 10 Jun 2015 11:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=uefK1Btm9C5R2vnkjUo/Fj+CrR39eJExVv5Pz7dxb0k=; b=slnxhQpaeWAK3Tdf8yRciORVQD+8+a/TpV//hI+QAzsj8tiCVbUaATkVI0GhFk4nB0 4VWHEW4lmO7w8iszFhOmiFNdyweabFr7X4FTJgDgrJZ0yDXPzugJMtoAvgimcrzHGqMo cHw9Ix6GavBtkfZWtJXu2+q1haujv1ra//y9drDGPnAFZglkAO7hOQpa378Jhe5ZswuB qnkjWz3m3KF1vRhDqdidSrWzgEr0V9ayy+gkJqYKYR46ZsOfYSbKOZJTghzBoVQ+oMbN BSHHsb6TFORFojwC+WhUKrOu6ISe4BPXOzgG2aAF9UcW37b7IchNB/btWFRRg2HTFu20 KUMA== MIME-Version: 1.0 X-Received: by 10.50.102.68 with SMTP id fm4mr7497780igb.25.1433959343031; Wed, 10 Jun 2015 11:02:23 -0700 (PDT) Received: by 10.36.3.75 with HTTP; Wed, 10 Jun 2015 11:02:22 -0700 (PDT) In-Reply-To: References: Date: Thu, 11 Jun 2015 02:02:22 +0800 Message-ID: To: Jakub Zelenka Cc: Yasuo Ohgaki , Derick Rethans , PHP internals list Content-Type: multipart/alternative; boundary=047d7b10c9f943ad2305182dad57 Subject: Re: [PHP-DEV] [VOTE] JSON number to string From: ppasindud@gmail.com (Pasindu De Silva) --047d7b10c9f943ad2305182dad57 Content-Type: text/plain; charset=UTF-8 Hi Guys It was state that JSON scheme will take some time to be implement and probably wouldn't be able for 5.6. IMHO JSON_FLOAT_AS_STRING probably it isn't the idle fix (the idle solution would be to not even have a bug/error like this), so the question would be, do we want developers decoding json with precision loss until JSON scheme eventually comes or give them the ability to decide for them self on how to proceed. +1 Pasindu On Wed, Jun 10, 2015 at 7:09 PM, Jakub Zelenka wrote: > Hi Yasuo, > > On Wed, Jun 10, 2015 at 11:57 AM, Yasuo Ohgaki wrote: > > > Hi Derick, > > > > On Wed, Jun 10, 2015 at 7:28 PM, Derick Rethans wrote: > > > >> > Hi, > >> > > >> > The voting is now open: > >> > > >> > https://wiki.php.net/rfc/json_numeric_as_string#voting > >> > >> FWIW, I voted no to all of them because (as you even say in the RFC), > >> this is probably better be solved with a JSON schema thingy. > > > > > > JSON Schema does not help to decoding/encoding numeric data without > > loosing data. > > > > JSON Schema Core > > http://json-schema.org/latest/json-schema-core.html#anchor8 > > Note: JSON specification does not specify precision. So number could be > > any number. > > > > JSON Schema Validation > > http://json-schema.org/latest/json-schema-validation.html#anchor5 > > > > Those who do not care rounding errors/etc, they can use default behavior. > > > > > The idea would be to use JSON schema just for selecting the type for > deserialized item in decoded JSON. It means that you could for example > select one float item that you want to decode as a string but other floats > would be still decoded as floats. That gives a better flexibility and helps > the problem in the same way. Please see my email to Alexey when we > discussed this RFC (there are few examples): > > https://www.mail-archive.com/internals@lists.php.net/msg78698.html > > Cheers > > Jakub > -- *Pasindu De Silva**ppasindud@gmail.com * --047d7b10c9f943ad2305182dad57--