Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78658 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82751 invoked from network); 4 Nov 2014 18:14:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 18:14:21 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.208 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.208 imap2-3.ox.privateemail.com Received: from [192.64.116.208] ([192.64.116.208:35124] helo=imap2-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/3D-06676-B7719545 for ; Tue, 04 Nov 2014 13:14:20 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 21DAC8C007D; Tue, 4 Nov 2014 13:14:17 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QeGOes0U_rVQ; Tue, 4 Nov 2014 13:14:16 -0500 (EST) Received: from oa-edu-170-172.wireless.abdn.ac.uk (oa-edu-170-172.wireless.abdn.ac.uk [137.50.170.172]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 2386C8C007B; Tue, 4 Nov 2014 13:14:15 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: Date: Tue, 4 Nov 2014 18:14:13 +0000 Cc: Ferenc Kovacs , Juan Basso , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <76457381-6DBD-4C20-B18F-7CFB9D2EC55A@ajf.me> References: To: Jakub Zelenka X-Mailer: Apple Mail (2.1990.1) Subject: Re: [PHP-DEV] Add a new flag for json_encode From: ajf@ajf.me (Andrea Faulds) > On 4 Nov 2014, at 17:07, Jakub Zelenka wrote: >=20 > I would really like to see it as default in the next major as it is a > useful feature. >=20 > However I don't like adding new flag. The reason for that is that it > becomes useless after 7 is realesed. It would be useful only for = >5.6.3 and > <7.0 though. The only use case in PHP 7 would be just to disable the = flag > but that won't be very nice and completely different than other json > constant usage It means doing something like $options & > ~JSON_PRESERVE_FRACTIONAL_PART ... It's a bit messy IMHO. Think that = it > would be much better to wait till 7 with this feature. I really don=E2=80=99t like the idea of making this the default. On = 32-bit systems, floats give you, effectively, extra integer range up = until you hit 2^52, and indeed all JS integer values are just floats = within that range. I don=E2=80=99t think they should be represented as = floats. It=E2=80=99d go weirdly with 64-bit PHP, which can decode such = values to integers, which would then not handle the range beyond 2^52 = nicely. Also, it wouldn=E2=80=99t go well for cross-version compatibility with = my bigint RFC here. -- Andrea Faulds http://ajf.me/