Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85717 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54569 invoked from network); 3 Apr 2015 19:10:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Apr 2015 19:10:23 -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 192.64.116.199 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.199 imap11-2.ox.privateemail.com Received: from [192.64.116.199] ([192.64.116.199:47724] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0E/93-23347-B95EE155 for ; Fri, 03 Apr 2015 14:10:22 -0500 Received: from localhost (localhost [127.0.0.1]) by imap11.ox.privateemail.com (Postfix) with ESMTP id 9C6918800E7; Fri, 3 Apr 2015 15:10:16 -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 5-xkwL8Te_UQ; Fri, 3 Apr 2015 15:10:16 -0400 (EDT) Received: from [137.50.29.37] (oa-res-29-37.wireless.abdn.ac.uk [137.50.29.37]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by imap11.ox.privateemail.com (Postfix) with ESMTPSA id 10A278800E2; Fri, 3 Apr 2015 15:10:13 -0400 (EDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-ID: <33BCE1D0-BA6D-464C-B23D-69AF71356111@ajf.me> Cc: PHP Internals , Nikita Popov X-Mailer: iPhone Mail (12D508) Date: Fri, 3 Apr 2015 20:10:06 +0100 To: Dmitry Stogov Subject: Re: Fix division by zero to throw exception From: ajf@ajf.me (Andrea Faulds) Hi Dmitry, > On 3 Apr 2015, at 20:04, Dmitry Stogov wrote: >=20 > 2) Very similar weird behavior was introduced for shift with negative offs= ets. I also propose to change it in the same way (Fatal error at compile-tim= e, Exception in run-time). >=20 > Any thoughts? objections? For consistency with IEEE 754, shouldn't we produce INF on a division by zer= o, at least for floats (but probably integers too because of weak typing)? I= don't think producing a warning is an issue, but FALSE isn't the right valu= e to produce. However there should be a compile-time solution. Maybe, if a division by zer= o happens, don't evaluate the expression at compile-time? Thanks. -- Andrea Faulds http://ajf.me/=