Re: [PHP-DEV] Re: Fix division by zero to throw exception

2015-04-04 Thread Marc Bennewitz
Am 04.04.2015 um 00:13 schrieb Andrea Faulds: On 3 Apr 2015, at 23:08, Dmitry Stogov wrote: On Apr 4, 2015 12:34 AM, "Nikita Popov" wrote: Don't think we need to disable compile-time evaluation for 2) and 3). It'll just end up being a compile error in that case. I think if you have 1 % 0

[PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread Andrea Faulds
> On 3 Apr 2015, at 23:08, Dmitry Stogov wrote: > > On Apr 4, 2015 12:34 AM, "Nikita Popov" wrote: > > > > Don't think we need to disable compile-time evaluation for 2) and 3). It'll > > just end up being a compile error in that case. I think if you have 1 % 0 > > occurring in your code liter

[PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread Dmitry Stogov
On Apr 4, 2015 12:34 AM, "Nikita Popov" wrote: > > On Fri, Apr 3, 2015 at 11:13 PM, Dmitry Stogov wrote: >> >> >> >> >> On Fri, Apr 3, 2015 at 11:59 PM, Andrea Faulds wrote: >>> >>> Hi, >>> >>> > On 3 Apr 2015, at 20:46, Dmitry Stogov wrote: >>> > >>> > May be you'll also suggest something rega

[PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread Nikita Popov
On Fri, Apr 3, 2015 at 11:13 PM, Dmitry Stogov wrote: > > > > On Fri, Apr 3, 2015 at 11:59 PM, Andrea Faulds wrote: > >> Hi, >> >> > On 3 Apr 2015, at 20:46, Dmitry Stogov wrote: >> > >> > May be you'll also suggest something regarding bitwise shifts with >> negative offset? >> > Allowing negat

[PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread Dmitry Stogov
On Fri, Apr 3, 2015 at 11:59 PM, Andrea Faulds wrote: > Hi, > > > On 3 Apr 2015, at 20:46, Dmitry Stogov wrote: > > > > May be you'll also suggest something regarding bitwise shifts with > negative offset? > > Allowing negative offsets using opposite directions would fix > inconsistency, but I r

[PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread Andrea Faulds
Hi, > On 3 Apr 2015, at 20:46, Dmitry Stogov wrote: > > May be you'll also suggest something regarding bitwise shifts with negative > offset? > Allowing negative offsets using opposite directions would fix inconsistency, > but I remember, you didn't like it. > May be keep WARNING (Bit shift by

[PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread Dmitry Stogov
On Fri, Apr 3, 2015 at 10: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

Re: [PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread 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 i

Re: [PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread Levi Morrison
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

[PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread Nikita Popov
On Fri, Apr 3, 2015 at 9:04 PM, Dmitry Stogov wrote: > 1) Division by zero behavior in PHP is really inconsistent. > It emits WARNING and returns FALLE. > > Note, that since PHP-5.6 division by zero may also occur in constant > expressions. They are compiled and evaluated only once (on first requ

[PHP-DEV] Re: Fix division by zero to throw exception

2015-04-03 Thread Andrea Faulds
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 wi