Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85720 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61273 invoked from network); 3 Apr 2015 19:32:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Apr 2015 19:32:20 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.169 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.214.169 mail-ob0-f169.google.com Received: from [209.85.214.169] ([209.85.214.169:34625] helo=mail-ob0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/94-23347-4CAEE155 for ; Fri, 03 Apr 2015 14:32:20 -0500 Received: by obbgh1 with SMTP id gh1so174775804obb.1 for ; Fri, 03 Apr 2015 12:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=dVgkkVuyXIFI35ZlvvoHeWgSJieCFFLU89LuxisM+JY=; b=XdO/moYB73jkbu6v4497cgaVJi1sEEsjZGkvSxMJHmpsfvO1JLgxKJ+RFxhvbm9dyu e1PS+9A90WAM6erFGwnIoLMHwZ8Ks2FfMA0JhKsSoY4sLl9MInCiCIpmOBdXBPujwDEr 4JitJOhxRZGp3ophLtE6apoYDpOWs5KiDf62rwX+gj1sctJXuWqiOh6GqWFaaWpF+rvI BGQuHnU/WcAHjB9G7QsXk+MIC2Fu90l+utuMFwhri29cBQ0XGt8ONSP6U+DQ1lEBhf1b 70expPa5i6Is51fV8Mt6WYGmH480ze3VBsjH8Y7NiY+m196lunuEnbnSAploHbvLenhG vLFQ== MIME-Version: 1.0 X-Received: by 10.60.155.135 with SMTP id vw7mr4660489oeb.62.1428089538143; Fri, 03 Apr 2015 12:32:18 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.76.93.136 with HTTP; Fri, 3 Apr 2015 12:32:18 -0700 (PDT) In-Reply-To: References: <33BCE1D0-BA6D-464C-B23D-69AF71356111@ajf.me> Date: Fri, 3 Apr 2015 13:32:18 -0600 X-Google-Sender-Auth: A_JAa7G7hnqLDKgyT0n7JjIhdbY Message-ID: To: Andrea Faulds Cc: Dmitry Stogov , PHP Internals , Nikita Popov Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: Fix division by zero to throw exception From: levim@php.net (Levi Morrison) On Fri, Apr 3, 2015 at 1:31 PM, Levi Morrison wrote: > On Fri, Apr 3, 2015 at 1:10 PM, Andrea Faulds wrote: >> Hi Dmitry, >> >>> On 3 Apr 2015, at 20:04, Dmitry Stogov wrote: >>> >>> 2) Very similar weird behavior was introduced for shift with negative offsets. I also propose to change it in the same way (Fatal error at compile-time, Exception in run-time). >>> >>> Any thoughts? objections? >> >> For consistency with IEEE 754, shouldn't we produce INF on a division by zero, 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 value to produce. > > I agree with Andrea. Currently we do floating point division even if > both arguments are integers, and the correct behavior for a floating > point divide by zero is to produce an INF or -INF. Well, correct as defined by IEEE 754 anyway.