Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86941 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2830 invoked from network); 29 Jun 2015 15:54:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jun 2015 15:54:44 -0000 Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.157 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.157 blu004-omc4s18.hotmail.com Received: from [65.55.111.157] ([65.55.111.157:57502] helo=BLU004-OMC4S18.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/C0-25761-24A61955 for ; Mon, 29 Jun 2015 11:54:43 -0400 Received: from BLU437-SMTP100 ([65.55.111.136]) by BLU004-OMC4S18.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Mon, 29 Jun 2015 08:54:39 -0700 X-TMN: [5Ink96BV80ayDS+35Jr3t5BYELnAXQ/F] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_10005EA7-68C9-403F-B1C3-F3F7E3B79D2D" MIME-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) In-Reply-To: Date: Mon, 29 Jun 2015 17:54:33 +0200 CC: Andrea Faulds , PHP Internals , Nikita Popov , Anatol Belski References: <33BCE1D0-BA6D-464C-B23D-69AF71356111@ajf.me> <3932E76B-DC75-40CD-8B1A-B84F387707CC@ajf.me> To: Dmitry Stogov X-Mailer: Apple Mail (2.2098) X-OriginalArrivalTime: 29 Jun 2015 15:54:35.0846 (UTC) FILETIME=[E5BB4660:01D0B283] Subject: Re: [PHP-DEV] Fix division by zero to throw exception (round 2) From: bobwei9@hotmail.com (Bob Weinand) --Apple-Mail=_10005EA7-68C9-403F-B1C3-F3F7E3B79D2D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" I would like to bring this topic back up, as there were users confused = with it and it's absolutely not consistent what we have now. See also https://bugs.php.net/bug.php?id=3D69957 = (As I thought it was = non-intentional, I went ahead and "fixed" it, was reverted later, hence = discussing that now here.) So, looks like there was some quick decisions and discussion I totally = had missed. What we have now is: > Am 03.04.2015 um 23:13 schrieb Dmitry Stogov : >=20 > So the summary: >=20 > 1) division by zero produces a warning and +/-INF IS_DOUBLE. = Compile-time > evaluation is disabled. >=20 > 3) Modulo by zero produces Exception.Compile-time evaluation is = disabled. Why? Why do we change the one but not the other? Why does 0 % 0 throw an Exception, but 0 / 0 NAN? Why does 1 % 0 throw an Exception, but 1 / 0 INF? I'd like to either properly return 0, INF or NAN in both cases or in = none. Having different rules for so similar operations is non-sense, I think. = It just is inconsistent and causes confusion. Bob= --Apple-Mail=_10005EA7-68C9-403F-B1C3-F3F7E3B79D2D--