Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86967 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37016 invoked from network); 30 Jun 2015 06:48:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jun 2015 06:48:36 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.170 mail-ig0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:32868] helo=mail-ig0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/3E-25761-1CB32955 for ; Tue, 30 Jun 2015 02:48:35 -0400 Received: by igcur8 with SMTP id ur8so55956853igc.0 for ; Mon, 29 Jun 2015 23:48:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=kdZxKd/RSr2JY2ajPs6PmXD/7nrhj+8H7c6EdXWVuY0=; b=WW5/WJZdSfer/mzdqjwPCsuPhvKEUqO5GQsfQa5+qDACPyhV5ZwcNwptQbTLl3gcam ndjO86PrGHOT35AurzSs3mQNkOOxjUhvjL4ZxI30Ewrfooeegn0+e76to44NIhXXdthR oJH59KoFY0Y1wFZE3tQhNDTcriD8OikuQs4ckrDVQ384pLdf9zlBkpnCG8+tf8asCChY VaBiUYTR10ON0jvwQZ9HA8UAPvE+3YPfHtQ8UCHNusWhDDKpMWCiiPdTJk/fcGNLDWGO D8xnQDH9WGAk+/+5bmRaD23ng1ftbF3XYwsQvoS4rL3ZHogiBUKUEhhyKh86q8bb3OYu jpjg== X-Gm-Message-State: ALoCoQnK4zePYY+jpOhxl3nrJpYM5t7znLYx+esD7s3F67CMy0/rsgMjaeZ9VU3u6BMkD1M8qREkp4vggrItRePhRNDGpRV9ri+dra9wZ5H5xOf4HDJ31T/ipJE6m3hJE/s8XGsO4i/oStuWPcZxKCqwWIXr2A9fWj+sKlDY96eBtDVaJ1mEf2A= MIME-Version: 1.0 X-Received: by 10.50.141.164 with SMTP id rp4mr21941879igb.2.1435646910133; Mon, 29 Jun 2015 23:48:30 -0700 (PDT) Received: by 10.50.241.50 with HTTP; Mon, 29 Jun 2015 23:48:30 -0700 (PDT) In-Reply-To: <1EFE20ED-ED80-47D1-B697-58CA4359CA62@ajf.me> References: <33BCE1D0-BA6D-464C-B23D-69AF71356111@ajf.me> <3932E76B-DC75-40CD-8B1A-B84F387707CC@ajf.me> <1EFE20ED-ED80-47D1-B697-58CA4359CA62@ajf.me> Date: Tue, 30 Jun 2015 09:48:30 +0300 Message-ID: To: Andrea Faulds Cc: Bob Weinand , PHP Internals , Nikita Popov , Anatol Belski Content-Type: multipart/alternative; boundary=089e012953801a2c900519b698e5 Subject: Re: [PHP-DEV] Fix division by zero to throw exception (round 2) From: dmitry@zend.com (Dmitry Stogov) --089e012953801a2c900519b698e5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I, personally, don't have strong opinion. Both behaviors work for me. Bob, if you are going to change this, please show the patch first. Thanks. Dmitry. On Mon, Jun 29, 2015 at 8:14 PM, Andrea Faulds wrote: > Hi again, > > > On 29 Jun 2015, at 18:02, Bob Weinand wrote: > > > > Yes, it generally makes sense... > > Then I have other questions: > > > > - Why do we then still have a Warning? Either we have well-defined > behavior, or we throw an exception. Well-defined behavior *plus* a warnin= g > 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/ > > > > > --089e012953801a2c900519b698e5--