Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78681 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26378 invoked from network); 4 Nov 2014 20:51:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 20:51:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.245 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.245 imap11-3.ox.privateemail.com Received: from [198.187.29.245] ([198.187.29.245:34109] helo=imap11-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/E3-02095-34C39545 for ; Tue, 04 Nov 2014 15:51:16 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 9009D8800F9; Tue, 4 Nov 2014 15:51:12 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id V8O1i0tJ1my7; Tue, 4 Nov 2014 15:51:12 -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 841C98800E7; Tue, 4 Nov 2014 15:51:10 -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 20:51:08 +0000 Cc: Ferenc Kovacs , Juan Basso , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <76457381-6DBD-4C20-B18F-7CFB9D2EC55A@ajf.me> 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 20:06, Jakub Zelenka wrote: >=20 > That's a good point. However I still think that there are more = advantages for making this the default. I like mainly the idea that = json_decode(json_encode($a)) =3D $a for all floats which is not the case = at the moment. Also it allow some other things that were mentioned = before. It won=E2=80=99t be with or without your changes, as JSON can=E2=80=99t = encode Infinity or NaN. Also, I don=E2=80=99t think it matters. PHP isn=E2=80=99t a = strictly-typed language where there=E2=80=99s an important difference = between float(7000) and int(7000). They act exactly the same in all = contexts. There=E2=80=99s no benefit to this change that I can see within PHP = (perhaps with other languages that have weird JSON parsers), and it = causes problems as I=E2=80=99ve said above. Thus, I can=E2=80=99t = support it being a default. -- Andrea Faulds http://ajf.me/