Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78727 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53768 invoked from network); 5 Nov 2014 16:23:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2014 16:23:30 -0000 Authentication-Results: pb1.pair.com header.from=jrbasso@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jrbasso@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.46 as permitted sender) X-PHP-List-Original-Sender: jrbasso@gmail.com X-Host-Fingerprint: 209.85.216.46 mail-qa0-f46.google.com Received: from [209.85.216.46] ([209.85.216.46:39849] helo=mail-qa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/80-50436-10F4A545 for ; Wed, 05 Nov 2014 11:23:29 -0500 Received: by mail-qa0-f46.google.com with SMTP id n8so720012qaq.19 for ; Wed, 05 Nov 2014 08:23:27 -0800 (PST) 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=4eUXrqkZ8WMmpV1Pigx84eIGxCIYI39HUZGu5gtjdFg=; b=jAinfxfHynZbPgOnpmzomqbjjHqbxasqFSr/zp2aRIEpvlD2ptFK1FVA4+E+Dtx+2X lu4uijAvhR/3Oi/9KMqyekO9EJsm/jQ2Y9QKUsbJsLyXEOpINBDCytMuJcRXiYPSCJ0j 6ulSVmnRwMJS5NvRquM+IpqxNE3UI9gx14FcyW35MgCNEkJcxiS0WoYscTXmFWVh8ok3 NgfubpR30i6K3jIn3Smvfqz2YyKSDDnrIyYegI4DfD9R1DTmge6Y5nlXsD1HEprsiP1H dH0JENPwRDv1w6NbmY6kGC+ftX20JFujDto0/s2iG8NrKevKc5dpbvA4Grmm/dtTOpF2 6rqg== MIME-Version: 1.0 X-Received: by 10.224.34.73 with SMTP id k9mr11961800qad.33.1415204607263; Wed, 05 Nov 2014 08:23:27 -0800 (PST) Received: by 10.140.28.181 with HTTP; Wed, 5 Nov 2014 08:23:27 -0800 (PST) In-Reply-To: References: Date: Wed, 5 Nov 2014 11:23:27 -0500 Message-ID: To: Chris Wright Cc: Jakub Zelenka , Ferenc Kovacs , PHP Internals Content-Type: multipart/alternative; boundary=001a11c2047ce688d205071effbd Subject: Re: [PHP-DEV] Add a new flag for json_encode From: jrbasso@gmail.com (Juan Basso) --001a11c2047ce688d205071effbd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I also prefer to use =E2=80=8Bdifferent flags if we enable by default. So i= f this behavior is enabled by default in 7.0 the JSON_PRESERVE_FRACTIONAL_PART is deprecated and a new flag is created to disable it. In resume of this thread, seems everyone if fine in having the flag JSON_PRESERVE_FRACTIONAL_PART added on 5.6 and leave this flag off by default to keep the BC. The only discussion is enable or not this behavior in 7.0. Andrea, I see your concerns about the bigint changes, but I am not sure if they are related. The PR just affect the encoding, not the decoding part. So if some Python system encodes a JSON using the decimal part it will be the same of PHP encoding using this new flag. So, if you think the decode can cause an issue on bigint, it needs a big concern for system interoperability on this part. Also, what I am proposing is not to change all integers in floats. What I am proposing with this flag is to make floats values (PHP zval) output as float in the JSON. It doesn't affect anything in the PHP variables. Juan Basso --001a11c2047ce688d205071effbd--