Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-03-10 Thread Marc Bennewitz
Hi Larry, On 10.03.24 16:52, Larry Garfield wrote: On Sun, Mar 10, 2024, at 10:31 AM, Gina P. Banyard wrote: On Saturday, 9 March 2024 at 16:00, Larry Garfield wrote: I am still opposed to this. Logically, ceil/float/round should be returning ints, not floats. Only returning ints if it was

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-03-10 Thread Larry Garfield
On Sun, Mar 10, 2024, at 10:31 AM, Gina P. Banyard wrote: > On Saturday, 9 March 2024 at 16:00, Larry Garfield > wrote: > >> I am still opposed to this. Logically, ceil/float/round should be returning >> ints, not floats. Only returning ints if it was given an int is, er, kinda >> pointless,

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-03-10 Thread Gina P. Banyard
On Saturday, 9 March 2024 at 16:00, Larry Garfield wrote: > I am still opposed to this. Logically, ceil/float/round should be returning > ints, not floats. Only returning ints if it was given an int is, er, kinda > pointless, as you'll just get back the value you passed in. (Because it's >

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-03-09 Thread Jim Winstead
On Sat, Mar 9, 2024, at 8:00 AM, Larry Garfield wrote: ]> If there's some math reason that we cannot have those functions return > int (someone mentioned there was, but I don't really understand it and > the RFC does not explain it at all), then we should at least keep > consistency in the

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-03-09 Thread Larry Garfield
On Sat, Mar 9, 2024, at 1:01 AM, Marc wrote: > Hi internals, > > Just want to resent this note about the updated RFC as there where no > comments last time and I'm unsure if this was due to mailing list issues. > > I now have updated the RFC to allow to opt-in to new behavior on PHP 8.4 > and be

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-03-08 Thread Marc
Hi internals, Just want to resent this note about the updated RFC as there where no comments last time and I'm unsure if this was due to mailing list issues. I now have updated the RFC to allow to opt-in to new behavior on PHP 8.4 and be able to opt-out to previous behavior in PHP 9.0 via

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2024-02-25 Thread Marc Bennewitz
Hi all, I now have updated the RFC to allow to opt-in to new behavior on PHP 8.4 and be able to opt-out to previous behavior in PHP 9.0 via new parameter "force_float". Also the deprecation has been removed as nobody liked it. Best regards, Marc On 26.09.23 12:39, Marc Bennewitz wrote: Hi

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-19 Thread Marc Bennewitz
Hi, On 26.09.23 12:39, Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding Best, Marc Based on the discussion I see two groups. The one that would like to change this behavior without message (bug fix) and others that see

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-19 Thread Marc Bennewitz
Hi Jakub, On 16.10.23 00:17, Jakub Zelenka wrote: Your JSON example is a bit unrelated because if you care about your types your should have used JSON_RESERVE_ZERO_FRACTION in the first place else you should not care about int vs float at all. The thing is that JSON might be encoded by

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-15 Thread Jakub Zelenka
Hi Marc, On Sat, Oct 14, 2023 at 1:21 AM Marc Bennewitz wrote: > Hi Jakub, > > On 13.10.23 13:25, Jakub Zelenka wrote: > > On Tue, Sep 26, 2023 at 11:39 AM Marc Bennewitz > wrote: > > > >> Hi internals > >> > >> I'd like to put a new RFC under discussion: > >>

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-13 Thread Marc Bennewitz
Hi Robert, On 13.10.23 13:44, Robert Landers wrote: On Fri, Oct 13, 2023 at 1:26 PM Jakub Zelenka wrote: On Tue, Sep 26, 2023 at 11:39 AM Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I would personally prefer a

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-13 Thread Marc Bennewitz
Hi Jakub, On 13.10.23 13:25, Jakub Zelenka wrote: On Tue, Sep 26, 2023 at 11:39 AM Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I would personally prefer a new function for rounding integers if anyone wants to

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-13 Thread Robert Landers
On Fri, Oct 13, 2023 at 1:26 PM Jakub Zelenka wrote: > > On Tue, Sep 26, 2023 at 11:39 AM Marc Bennewitz wrote: > > > Hi internals > > > > I'd like to put a new RFC under discussion: > > https://wiki.php.net/rfc/integer-rounding > > > > > I would personally prefer a new function for rounding

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-13 Thread Jakub Zelenka
On Thu, Oct 5, 2023 at 8:57 PM Tim Düsterhus wrote: > While this is not a bug fix that is appropriate for the current stable > branches, I don't see why it would not be appropriate for PHP 8.4 if > there's an RFC for it. > > In fact there is already a rounding bugfix (no RFC for that) in PHP

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-13 Thread Jakub Zelenka
On Tue, Sep 26, 2023 at 11:39 AM Marc Bennewitz wrote: > Hi internals > > I'd like to put a new RFC under discussion: > https://wiki.php.net/rfc/integer-rounding > > I would personally prefer a new function for rounding integers if anyone wants to round large integers. The things is that the

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-06 Thread Marc Bennewitz
Hi Tim, On 05.10.23 21:57, Tim Düsterhus wrote: Hi On 10/4/23 08:35, Marc Bennewitz wrote: As far as I understand you are in favor of option 1. (considering it a bugfix) but how do you make sure this will not lead to different application behavior overlooked on upgrading? Also there is no way

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-06 Thread Marc Bennewitz
Hi George, On 05.10.23 14:12, G. P. B. wrote: On Thu, 5 Oct 2023 at 07:40, Marc Bennewitz wrote: I don't see a bug or broken behavior here as these functions were processing floating point numbers since forever. https://3v4l.org/PrrmO That's not my point, the point is about the

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-05 Thread Tim Düsterhus
Hi On 10/4/23 08:35, Marc Bennewitz wrote: As far as I understand you are in favor of option 1. (considering it a bugfix) but how do you make sure this will not lead to different application behavior overlooked on upgrading? Also there is no way to opt-in new behavior. Yes, I would be in

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-05 Thread G. P. B.
On Thu, 5 Oct 2023 at 07:40, Marc Bennewitz wrote: > I don't see a bug or broken behavior here as these functions were > processing floating point numbers since forever. > > https://3v4l.org/PrrmO > That's not my point, the point is about the function being broken for large 64bit integers,

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-05 Thread Marc Bennewitz
On 05.10.23 01:38, G. P. B. wrote: On Tue, 26 Sept 2023 at 11:39, Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I don't understand the point of the deprecation phase at all. Frankly, I consider this RFC a bug fix

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-04 Thread G. P. B.
On Tue, 26 Sept 2023 at 11:39, Marc Bennewitz wrote: > Hi internals > > I'd like to put a new RFC under discussion: > https://wiki.php.net/rfc/integer-rounding I don't understand the point of the deprecation phase at all. Frankly, I consider this RFC a bug fix of the current "broken"

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-04 Thread Marc Bennewitz
Hi, On 03.10.23 14:41, Tim Düsterhus wrote: Hi On 9/30/23 08:26, Marc Bennewitz wrote: The deprecation would act as an information for upcoming behavior change, not classical deprecation of future removal. If the new behavior is what you want, than you don't need to change anything as a

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-03 Thread Tim Düsterhus
Hi On 9/30/23 08:26, Marc Bennewitz wrote: The deprecation would act as an information for upcoming behavior change, not classical deprecation of future removal. If the new behavior is what you want, than you don't need to change anything as a deprecation message should not break anything. At

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-03 Thread Marc
Hi, On 26.09.23 12:39, Marc Bennewitz wrote: I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I tried to make the RFC text a bit more clear. As I'm not a native English speaker I would be very welcome for wording suggestions and/or grammar fixes

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-30 Thread Marc Bennewitz
Hi Tim, On 29.09.23 17:28, Tim Düsterhus wrote: Hi On 9/26/23 12:39, Marc Bennewitz wrote: I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I find the proposal reasonable, but I don't like the deprecation proposal, because it does not allow me to opt

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-29 Thread Tim Düsterhus
Hi On 9/26/23 12:39, Marc Bennewitz wrote: I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding I find the proposal reasonable, but I don't like the deprecation proposal, because it does not allow me to opt into the *new* behavior before PHP 9.0 arrives.

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-29 Thread Saki Takamachi
Hi, Marc. > All of these functions already take an `int|float` and therefore the setting > of `strict_types` is irrelevant here on passing float vs. int. Oops, excuse me, I completely misunderstood the signature. Saki -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe,

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-29 Thread Marc Bennewitz
Hi Saki, On 27.09.23 02:18, Saki Takamachi wrote: Hi, Marc. There is one additional case to consider. It's backwards compatible. If `strict_types` is not `1`, the code currently out there may be passing `int` to these functions. Therefore, it is better to be aware that such code can have

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-27 Thread Derick Rethans
On Tue, 26 Sep 2023, Larry Garfield wrote: > ceil and floor should > always return ints, unconditionally, because that's literally what > their purpose is. But that RFC doesn't say that, which makes me quite > confused. They can't do that. ceil(2.4e102) can't be repesented as an integer. >

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-26 Thread Saki Takamachi
Hi, Marc. There is one additional case to consider. It's backwards compatible. If `strict_types` is not `1`, the code currently out there may be passing `int` to these functions. Therefore, it is better to be aware that such code can have destructive effects, and to consider whether or not to

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-26 Thread Marc Bennewitz
Hi Larry, On 26.09.23 20:41, Larry Garfield wrote: On Tue, Sep 26, 2023, at 10:39 AM, Marc Bennewitz wrote: Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding Best, Marc I'm honestly kind of confused by this. The basic concept, as I

Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-26 Thread Larry Garfield
On Tue, Sep 26, 2023, at 10:39 AM, Marc Bennewitz wrote: > Hi internals > > I'd like to put a new RFC under discussion: > https://wiki.php.net/rfc/integer-rounding > > Best, > Marc I'm honestly kind of confused by this. The basic concept, as I understand it, is sound. But the rest of the

[PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-09-26 Thread Marc Bennewitz
Hi internals I'd like to put a new RFC under discussion: https://wiki.php.net/rfc/integer-rounding Best, Marc OpenPGP_0x3936ABF753BC88CE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature