Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-04 Thread Bob Weinand
> Am 5.7.2015 um 01:52 schrieb Sherif Ramadan : > On Sat, Jul 4, 2015 at 7:30 PM, Bob Weinand > wrote: > At that point it's just a bit weird. The @ operator IMO shouldn't be the > recommended way to handle fundamental operations. > > I don't think suppressing the erro

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-04 Thread Aaron Piotrowski
> On Jul 4, 2015, at 6:30 PM, Bob Weinand wrote: > > >> Am 05.07.2015 um 00:50 schrieb Andrea Faulds : >> >> Hey Sherif, >> >>> On 4 Jul 2015, at 21:56, Sherif Ramadan wrote: >>> >>> I'm proposing that we reconsider removing the warning from floating point >>> division and here's why. >>>

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-04 Thread S.A.N
> You ideally just check if the divisor is 0 and then do the operation. > And at that point, we should just throw the DivisionByZeroError. > > Honestly, a warning is just the wrong thing to use. Either you enable it > (like double division in C) or disable it completely (runtime exception in C). >

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-04 Thread Bob Weinand
> Am 05.07.2015 um 00:50 schrieb Andrea Faulds : > > Hey Sherif, > >> On 4 Jul 2015, at 21:56, Sherif Ramadan wrote: >> >> I'm proposing that we reconsider removing the warning from floating point >> division and here's why. >> >> While IEEE 754 defines special values for floating point arit

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-04 Thread Andrea Faulds
Hey Sherif, > On 4 Jul 2015, at 21:56, Sherif Ramadan wrote: > > I'm proposing that we reconsider removing the warning from floating point > division and here's why. > > While IEEE 754 defines special values for floating point arithmetic when > division by zero occurs, there's nothing stoppin

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-04 Thread Bob Weinand
> Am 4.7.2015 um 23:09 schrieb Niklas Keller : > > 2015-07-04 22:56 GMT+02:00 Sherif Ramadan >: > Hey guys, > > I'm proposing that we reconsider removing the warning from floating point > division and here's why. > > While IEEE 754 defines special values for floa

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-04 Thread Niklas Keller
2015-07-04 22:56 GMT+02:00 Sherif Ramadan : > Hey guys, > > I'm proposing that we reconsider removing the warning from floating point > division and here's why. > > While IEEE 754 defines special values for floating point arithmetic when > division by zero occurs, there's nothing stopping the lang

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-04 Thread Sherif Ramadan
Hey guys, I'm proposing that we reconsider removing the warning from floating point division and here's why. While IEEE 754 defines special values for floating point arithmetic when division by zero occurs, there's nothing stopping the language from providing useful error information to the user,

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-02 Thread Jakub Kubíček
+1 for everything proposed here :-) Kubo2 2015-07-02 9:59 GMT+02:00 Dmitry Stogov : > On Thu, Jul 2, 2015 at 3:26 AM, Bob Weinand wrote: > >> > Am 29.06.2015 um 19:14 schrieb Andrea Faulds : >> > >> > Hi again, >> > >> >> On 29 Jun 2015, at 18:02, Bob Weinand wrote: >> >> >> >> Yes, it genera

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-02 Thread Dmitry Stogov
On Thu, Jul 2, 2015 at 3:26 AM, Bob Weinand wrote: > > Am 29.06.2015 um 19:14 schrieb Andrea Faulds : > > > > 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 Warni

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-01 Thread Andrea Faulds
Hi Bob, > On 2 Jul 2015, at 01:26, Bob Weinand wrote: > >> Am 29.06.2015 um 19:14 schrieb Andrea Faulds : >> >> Hmm. Using Error might make some sense given it used to raise E_WARNING. I >> think DivisionByZeroError sounds like a good idea. > > Hey, > > I just committed that to master… Grea

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-01 Thread Bob Weinand
> Am 29.06.2015 um 19:14 schrieb Andrea Faulds : > > 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 exceptio

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-06-29 Thread Dmitry Stogov
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 generall

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-06-29 Thread Andrea Faulds
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 warning is IMO > non-sense.

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-06-29 Thread Bob Weinand
Hey Andrea, > Am 29.06.2015 um 18:49 schrieb Andrea Faulds : > > Hi Bob, > >> On 29 Jun 2015, at 16:54, Bob Weinand wrote: >> >> 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.

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-06-29 Thread Andrea Faulds
Hi Bob, > On 29 Jun 2015, at 16:54, Bob Weinand wrote: > > 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=69957 (As I thought it was > non-intentional, I went ahead

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-06-29 Thread Nikita Popov
On Mon, Jun 29, 2015 at 5:54 PM, Bob Weinand wrote: > 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=69957 (As I thought it was > non-intentional, I went ahead and "fi

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-06-29 Thread Bob Weinand
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=69957 (As I thought it was non-intentional, I went ahead and "fixed" it, was revert