Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91366 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2079 invoked from network); 24 Feb 2016 00:48:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2016 00:48:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.172 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.172 mail-pf0-f172.google.com Received: from [209.85.192.172] ([209.85.192.172:34853] helo=mail-pf0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/77-38634-7DDFCC65 for ; Tue, 23 Feb 2016 19:48:24 -0500 Received: by mail-pf0-f172.google.com with SMTP id c10so2143067pfc.2 for ; Tue, 23 Feb 2016 16:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=mMg4ZoCjUWul8SEiYZ/dHA0c1ed2FoAOHTTRZ9YMWVY=; b=N4CWLAxukCY5O0QiDXhf3RTweSJVgLELmfb53b/WRKtKK9RJ0OycoYy7RfGT8IPeag /8HP3uY0mUX8t1ehRCN4VjE0HsF1rCv382n3s7wpL7oNvEOm+7LnmtPEZP/LBqGV/cyU VL7+0U/5zyPg/qDKYTQF4BkVGpOjZR9g9qeIWMPST17Ui/wFTyajfD2S2cra4xk4iwQr nGSuIq3BnS5FsBO1ufL0Fbs87hKYvngvm5i79KXxSXmTNxpQgho+XeqsTUWlrZyNmwtq Dy4KIJofYKgL7tmIY62Z+dLkKIs4/mhBT5SiAd0r81vkZ4TFF9w88nc/4jSTjIEmDX6o kzAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=mMg4ZoCjUWul8SEiYZ/dHA0c1ed2FoAOHTTRZ9YMWVY=; b=HwQ8uZ4hHxqACvF4hSRdE4HE89e/IrfMcGmkDhBoHxN3FKd0L9auTFFRsA7K2n77ja 3wJYldKJjUL0eoojflqCLEGDs22bTqA9IpMeUQNSkm+/1ZJT4ve+0MDPJbj1kJo5gLaY t/PZiq2IxhYN8CYGEGrCvnvOHWueXN7ZgVckmJdc94B2VjrMfiyAP6oY07QgZUM/xcaF rDO3v+Fh5ldjD9umVsuu8/T/nPDJdCwb6DuRTBggMvCtUr/urEqAs/LxzYYJeQOsSE9U jCjMeSPcDCa3w6t9x8Zxkwd+DFFpKZy7Z3xFNHMgzQwtjRbcl56w2NnaOKqIH8UndOCK hYVg== X-Gm-Message-State: AG10YOTpoTlxG9KLethx/BlfHXN5/KoMBaSf14Q+49a17Jnu8Q5nIrNaAklXm1UEKlmyHw== X-Received: by 10.98.73.205 with SMTP id r74mr50773334pfi.118.1456274901358; Tue, 23 Feb 2016 16:48:21 -0800 (PST) Received: from Stas-Air.local (108-201-189-144.lightspeed.sntcca.sbcglobal.net. [108.201.189.144]) by smtp.gmail.com with ESMTPSA id o90sm312053pfi.17.2016.02.23.16.48.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Feb 2016 16:48:20 -0800 (PST) To: Andrea Faulds , internals@lists.php.net References: <47.95.38634.798BCC65@pb1.pair.com> X-Enigmail-Draft-Status: N1110 Message-ID: <56CCFDD2.4000102@gmail.com> Date: Tue, 23 Feb 2016 16:48:18 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <47.95.38634.798BCC65@pb1.pair.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] Deprecations for PHP 7.1 From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > 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. -- Stas Malyshev smalyshev@gmail.com