Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91372 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35655 invoked from network); 24 Feb 2016 06:40:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2016 06:40:42 -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.170 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-yk0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:34342] helo=mail-yk0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/F9-38634-9605DC65 for ; Wed, 24 Feb 2016 01:40:41 -0500 Received: by mail-yk0-f170.google.com with SMTP id u9so4096905ykd.1 for ; Tue, 23 Feb 2016 22:40:41 -0800 (PST) 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=GDKkLM8zyDz/b/tz2jkpz79iFf7Qh0HUUKs0Ex55sTA=; b=OdZvTjNzwgVMHDpTgf8Pueo+d4id1flQSpmNdX69854Ows4lP5qL6xJEHMRDY2djUL pckZ+o2ItJHIB0wCZ9cP7nh7Pl2GumgfYLyKXFa3gTW4JXMmDMxQwOKVf3T+iVxkzCSp Tr4wfWCWu92cZbUFvIJwL2uIr2fYYdzfHe+bMepcMb1zjTo/283SCLlgm0Rz+natLmH+ bqWrnlUv4xYE9HPorzVR1rkDSMGaC01XokJosxQ89pDr4vzLtlxblf6mqkgAaRyhSfBt mhlfnluAuEVYCkozbdWgWsI9LBWJcjvYiShmsKaInLhTHrS1BPOCcwygUDAwVq8HKdn7 QgAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=GDKkLM8zyDz/b/tz2jkpz79iFf7Qh0HUUKs0Ex55sTA=; b=LBeXFija0TjHg+/0hHC/UZU807BPk5j4jJeTDgneuT/L9uUJkaOoq12QdYalccUEjP MMYD8+H6HW+2k2FKuYgySt7wAM9kg46yINEug0l6fZzCsXUxcgLVUQ95NwlpkTvB6Mnp kfqKr+H1kvKlL8wMkx3tWBr0XDZaEBZnAH8ULMPKUhzX1taML8kG/Yk62RWSUmzLOLLF PK1gu+DBUWyvhxDpYp+kuJ4QeqWtPOmFWClrGmWvdYzSTknWbI0bus0pTGVFProu1ayk 7n86MTn+/QRQ9Uousc1UMRDUgKZTEyb9U/bQOPR2k/D5SQuz0mGsGO+fUd6lXTG/p/IQ H/Mg== X-Gm-Message-State: AG10YOSfDSQMmhcWt/tVA+jRkxeQuErFyCQ6zD3djCcqGg1cfedP0mN5gwHeGStMX6d2IXSBTeD+iYZSMgD4oQ== X-Received: by 10.37.1.139 with SMTP id 133mr10382568ybb.27.1456296039011; Tue, 23 Feb 2016 22:40:39 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.129.109.22 with HTTP; Tue, 23 Feb 2016 22:39:59 -0800 (PST) In-Reply-To: <56CCFDD2.4000102@gmail.com> References: <47.95.38634.798BCC65@pb1.pair.com> <56CCFDD2.4000102@gmail.com> Date: Wed, 24 Feb 2016 15:39:59 +0900 X-Google-Sender-Auth: LA22oGWKgxGcLh7Nl6_-JEH1yNM Message-ID: To: Stanislav Malyshev Cc: Andrea Faulds , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: [RFC] Deprecations for PHP 7.1 From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi, On Wed, Feb 24, 2016 at 9:48 AM, Stanislav Malyshev wrote: >> foot, by discarding possibly important information when serialising - an >> operation that's supposed to perfectly reproduce a value! > > I'm not sure this is correct. Also, for values that are not exactly > representable in binary, I'm not sure you want to see > 0.1000000000000000055511151231257827021181583404541015625 instead of > 0.1. You certainly don't want var_dump to print that by default - this > would make display cluttred and have very high WTF factor - why I > entered 0.1 and get this enormous snake of a number? PHP must be broken! > Moreover, when you do "$a = 8.2 - 0.2" and then print/send $a, do you > want to see 8 or 7.99999999999999911182158029987476766109466552734375? > > In fact, when we represent 0.1 as 0.1 when serializing our outputting, > we are not discarding information, on the contrary - we are preserving > exactly the information that was given to us by user. > >> print floats to their full precision - including in var_dump(). This can >> create unreasonable confusion when debugging (why are two numbers that >> appear identical with var_dump() reported as inequal?), means > > You really think that displaying 8.2 - 0.2 as 8 is more confusing than > displaying it as 7.99999999999999911182158029987476766109466552734375? > >> potentially important information is removed by default, and really >> ought not to be a global setting anyway: if you want to format your >> numbers with reduced precision, do so explicitly. > > That would mean optimizing for case that nobody wants, and de-optimizing > case that pretty much everybody wants. Ask 100 people using PHP what > they want as a result of 8.2 - 0.2 and count how many of them want to > see full-precision monster of a number. > >> There might be others worth dealing with, too, these are just the first >> three I thought of. > > I would very much advise not to mess with any options until we are > definitely, 100%, without any doubt sure that nobody needs to use it for > anything. Removing options earns us nothing in terms of functionality. > If nobody uses them - ok, fine - drop them. If we need to remove them > e.g. because component they address goes away or changes function in a > way that makes it irrelevent - fine, drop them. But doing it just > because very small number of people that we can engage in discussion on > the list (and that's not going to ever change - PHP user community is > vastly larger than people even reading this list, let alone actively > participating in it) think it's not needed IMHO is a very wrong > approach. Sometimes we have no choice but to take decisions with this > incomplete knowledge - but here we have a perfectly good option of just > leaving it alone. All other options should be weighted against it. This discussion is related to https://wiki.php.net/rfc/precise_float_value If you have comment on this, I appreciate it. Please search old thread for discussions. I'll start final RFC discussion for this when session RFC is finished. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net