Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86946 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18784 invoked from network); 29 Jun 2015 17:15:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jun 2015 17:15:13 -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 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:47467] helo=imap11-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/E2-25761-F1D71955 for ; Mon, 29 Jun 2015 13:15:12 -0400 Received: from localhost (localhost [127.0.0.1]) by imap11.ox.privateemail.com (Postfix) with ESMTP id BEDDF8800E6; Mon, 29 Jun 2015 13:15:07 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from imap11.ox.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5b-29s7VAhD3; Mon, 29 Jun 2015 13:15:07 -0400 (EDT) Received: from [192.168.0.3] (unknown [90.211.5.114]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by imap11.ox.privateemail.com (Postfix) with ESMTPSA id 9D2328800DB; Mon, 29 Jun 2015 13:15:05 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) In-Reply-To: Date: Mon, 29 Jun 2015 18:14:32 +0100 Cc: Dmitry Stogov , PHP Internals , Nikita Popov , Anatol Belski Content-Transfer-Encoding: quoted-printable Message-ID: <1EFE20ED-ED80-47D1-B697-58CA4359CA62@ajf.me> References: <33BCE1D0-BA6D-464C-B23D-69AF71356111@ajf.me> <3932E76B-DC75-40CD-8B1A-B84F387707CC@ajf.me> To: Bob Weinand X-Mailer: Apple Mail (2.2098) Subject: Re: [PHP-DEV] Fix division by zero to throw exception (round 2) From: ajf@ajf.me (Andrea Faulds) Hi again, > On 29 Jun 2015, at 18:02, Bob Weinand wrote: >=20 > Yes, it generally makes sense... > Then I have other questions: >=20 > - Why do we then still have a Warning? Either we have well-defined = behavior, or we throw an exception. Well-defined behavior *plus* a = warning is IMO non-sense. That=E2=80=99s weird, yeah. We don=E2=80=99t throw warnings for the math = functions when you give them odd inputs, e.g. sin(INF) is just NAN, no = warning. I think removing it would make sense. > - Is it intentional for intdiv and % to throw an Exception instead of = Error or some more specific DivisionByZeroError or similar? (yes, I = know, Error is only very recent, but the question still needs to be = asked). Hmm. Using Error might make some sense given it used to raise E_WARNING. = I think DivisionByZeroError sounds like a good idea. -- Andrea Faulds http://ajf.me/