Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-05-31 Thread G. P. B.
Hello Internals, Round 2, I'm planning to open voting tomorrow, the only change being is handling of string digits to behave like doing an ASCII string range: https://wiki.php.net/rfc/proper-range-semantics Any final comments or complaints should be raised now. Best regards, George P. Banyard

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-05-16 Thread G. P. B.
On Tue, 16 May 2023 at 17:49, Jorg Sowa wrote: > Thank you. That makes sense. I have last question about case with integer > and string digit, i.e. range('5', 10) or range('1', 9). What would be in > this case expected output? I couldn't find any test cases covering this > example. > I've added

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-05-16 Thread Jorg Sowa
Thank you. That makes sense. I have last question about case with integer and string digit, i.e. range('5', 10) or range('1', 9). What would be in this case expected output? I couldn't find any test cases covering this example. Kind regards, Jorg On Tue, May 16, 2023 at 2:29 PM G. P. B. wrote:

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-05-16 Thread G. P. B.
On Mon, 15 May 2023 at 23:53, Jorg Sowa wrote: > Hello! > > I have one concern about the part: > > > Emit an E_WARNING when $start or $end is cast to an integer because the > other boundary input is a number or numeric string. (e.g. range > ('5', 'z'); or range

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-05-15 Thread Jorg Sowa
Hello! I have one concern about the part: > Emit an E_WARNING when $start or $end is cast to an integer because the other boundary input is a number or numeric string. (e.g. range ('5', 'z'); or range (5, 'z');) Doesn't it limit the

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-05-15 Thread G. P. B.
Hello Internals, I plan to put the RFC to a vote tomorrow in its current state, which has not been changed since the 30th of March: https://wiki.php.net/rfc/proper-range-semantics Any final comments or complaints should be raised now. Best regards, George P. Banyard

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-05-08 Thread G. P. B.
On Fri, 5 May 2023 at 15:49, Derick Rethans wrote: > On Mon, 27 Mar 2023, G. P. B. wrote: > > > While working on analysing the impact of the changes proposed by > > amending the behaviour of the increment and decrement operators ( > > https://wiki.php.net/rfc/saner-inc-dec-operators) I

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-05-05 Thread Derick Rethans
On Mon, 27 Mar 2023, G. P. B. wrote: > While working on analysing the impact of the changes proposed by > amending the behaviour of the increment and decrement operators ( > https://wiki.php.net/rfc/saner-inc-dec-operators) I discovered that > the range() function has some rather lax behaviour

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-03-30 Thread Kamil Tekiela
> > I've changed the behaviour to throw a ValueError if a negative step is > provided with increasing range and accept negative steps for decreasing > ranges. > I am not sure this is better. This would introduce a BC break because now it's not as easy to avoid the error as you can't just wrap the

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-03-30 Thread G. P. B.
On Thu, 30 Mar 2023 at 03:50, Mark Baker wrote: > On 28/03/2023 00:36, G. P. B. wrote: > > Hello internals, > > > > While working on analysing the impact of the changes proposed by amending > > the behaviour of the increment and decrement operators ( > >

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-03-29 Thread Mark Baker
On 28/03/2023 00:36, G. P. B. wrote: Hello internals, While working on analysing the impact of the changes proposed by amending the behaviour of the increment and decrement operators ( https://wiki.php.net/rfc/saner-inc-dec-operators) I discovered that the range() function has some rather lax

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-03-29 Thread Niels Dossche
Hi On 28/03/2023 14:42, G. P. B. wrote: > On Tue, 28 Mar 2023 at 08:19, Christian Schneider > wrote: > >> Am 28.03.2023 um 00:36 schrieb G. P. B. : >>> I therefore propose the "Define proper semantics for range() function" >> RFC >>> to address the unintuitive behaviour that sees no usage

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-03-28 Thread Christian Schneider
Am 28.03.2023 um 14:42 schrieb G. P. B. : > On Tue, 28 Mar 2023 at 08:19, Christian Schneider > wrote: >> There are two cases I would handle differently: >> - I'm not sure why a negative step for $start > $end is considered wrong, I >> consider range(10, 0, -2) at least as logical/readable as

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-03-28 Thread G. P. B.
On Tue, 28 Mar 2023 at 08:29, Tim Düsterhus wrote: > Hi > > On 3/28/23 00:36, G. P. B. wrote: > > I therefore propose the "Define proper semantics for range() function" > RFC > > to address the unintuitive behaviour that sees no usage and/or hide bugs: > >

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-03-28 Thread G. P. B.
On Tue, 28 Mar 2023 at 08:19, Christian Schneider wrote: > Am 28.03.2023 um 00:36 schrieb G. P. B. : > > I therefore propose the "Define proper semantics for range() function" > RFC > > to address the unintuitive behaviour that sees no usage and/or hide bugs: > >

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-03-28 Thread Tim Düsterhus
Hi On 3/28/23 00:36, G. P. B. wrote: I therefore propose the "Define proper semantics for range() function" RFC to address the unintuitive behaviour that sees no usage and/or hide bugs: https://wiki.php.net/rfc/proper-range-semantics The "ASCII code point range" example is confusing, because

Re: [PHP-DEV] [RFC] Define proper semantics for range() function

2023-03-28 Thread Christian Schneider
Am 28.03.2023 um 00:36 schrieb G. P. B. : > I therefore propose the "Define proper semantics for range() function" RFC > to address the unintuitive behaviour that sees no usage and/or hide bugs: > https://wiki.php.net/rfc/proper-range-semantics > > The change propose to throw TypeErrors and