Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87378 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45700 invoked from network); 29 Jul 2015 22:44:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2015 22:44:46 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.178 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.160.178 mail-yk0-f178.google.com Received: from [209.85.160.178] ([209.85.160.178:33757] helo=mail-yk0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/C2-25901-E5759B55 for ; Wed, 29 Jul 2015 18:44:46 -0400 Received: by ykba194 with SMTP id a194so20729018ykb.0 for ; Wed, 29 Jul 2015 15:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=ueWpzXpIAZrrlar2Dpgwjk78V34tfadrJ50eTIP5jf4=; b=BqLUzQ31WfYvJkkOOrmjUQY+pbVBUbiwvoc12vC5AWQcg89K4fwwGyRPimgVr2ZKto WlpaKMY6gUo/e/Q65NJRd5FhUHxW7P3idEKEkRx4SIWsvFDbAOYJLf88Nk2dyN1n9IMB AMN7GKEacd4WsPBfjowK4tFNUg6W9y3R990b3y6I27AaQYyWGgYgpbA1Cd5Luiloz2Bs piXFfY/Dmydo+S0tYtAKmC+tPwkh3sa+WU8iBb9fm84KPB4iJIgdPu1pX7a81WWSrEu4 7WigA4J1exnU64oi8ra7j+Ls+WKAizDmaIXASUZGDP1S931MVaJ7Cm63dHWDGtSbATSv dMGQ== X-Received: by 10.170.207.195 with SMTP id y186mr47783839yke.2.1438209883035; Wed, 29 Jul 2015 15:44:43 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.129.40.77 with HTTP; Wed, 29 Jul 2015 15:44:03 -0700 (PDT) In-Reply-To: References: Date: Thu, 30 Jul 2015 07:44:03 +0900 X-Google-Sender-Auth: iYN4MgqeUTRNQO56mA8J0aOSiIE Message-ID: To: Nikita Popov Cc: Jakub Zelenka , Anthony Ferrara , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1139e11c30de4d051c0b550f Subject: Re: [PHP-DEV] json_decode/encode should return full precision values by default From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1139e11c30de4d051c0b550f Content-Type: text/plain; charset=UTF-8 Hi Nikita, On Thu, Jul 30, 2015 at 1:13 AM, Nikita Popov wrote: > Instead of continuing to use serialize_precision, which will produce > unnecessarily long outputs for many values, why don't we just switch to > using the 0 mode of zend_dtoa, i.e. to return the shortest output that is > still accurate if interpreted in round-to-nearest. I think this is what > everybody else is using when they convert floating point numbers to > strings. I guess we may not be able to change normal floating point > printing to use this, but this seems like the best mode for anything using > serialize_precision now and everything that should be using it (like JSON, > and queries, etc). I prefer your proposal! Your proposal is a lot better than now. Anyone has opinion for this? I'm writing the RFC and I would like to make this the first option. i.e. serialize_precision=0 uses "zend_dtoa 0 mode" for all data exchange functions (json/serialize/var_exrport. Anyone care about WDDX/XML_RPC?) Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1139e11c30de4d051c0b550f--