Re: [PHP-DEV][RFC] Saner numeric strings

2020-07-14 Thread G. P. B.
Hello internals, Apologies again for the delay, I was pointed out a sort of inconsistency between arithmetic/bitwise ops and type declarations. I've tried to address this in the RFC by promoting all current warnings to TypeErrors: https://wiki.php.net/rfc/saner-numeric-strings Please have a look

Re: [PHP-DEV][RFC] Saner numeric strings

2020-07-10 Thread G. P. B.
Good afternoon Internals, I rewrote the RFC to improve clarity but the content is mostly identical with one small change is that the warning change from 'Illegal offset type' to 'String cast occurred' for string offsets such as '5.5' will be a secondary implementation vote as it adds some boilerpl

Re: [PHP-DEV][RFC] Saner numeric strings

2020-07-02 Thread G. P. B.
On Wed, 1 Jul 2020 at 18:44, Rowan Tommins wrote: > Hi George, > > On Wed, 1 Jul 2020 at 15:26, G. P. B. wrote: > >> >>2. Emit the E_WARNING "Illegal string offset" and evaluate to 0 for >>offsets like '2str', and emit the E_WARNING "String offset cast >>occurred" for float numeric s

Re: [PHP-DEV][RFC] Saner numeric strings

2020-07-01 Thread Rowan Tommins
Hi George, On Wed, 1 Jul 2020 at 15:26, G. P. B. wrote: > >2. Emit the E_WARNING "Illegal string offset" and evaluate to 0 for >offsets like '2str', and emit the E_WARNING "String offset cast >occurred" for float numeric strings like '2.5' I'm not clear how this option fits with t

Re: [PHP-DEV][RFC] Saner numeric strings

2020-07-01 Thread G. P. B.
Hello again, While reviewing the implementation Nikita spotted a peculiar behaviour that PHP currently has in regards to string offsets. The offset is validated using the is_numeric_string but integer representation of it is computed using an explicit int cast, this is what leads to the E_NOTICE

Re: [PHP-DEV][RFC] Saner numeric strings

2020-07-01 Thread G. P. B.
I've added a test case just to ensure that casting of leading numeric strings yields the previous behaviour and have added this to the BC Break section of the RFC: https://wiki.php.net/rfc/saner-numeric-strings Any other feedback or questions are welcomed. George P. Banyard

Re: [PHP-DEV][RFC] Saner numeric strings

2020-06-29 Thread G. P. B.
On Mon, 29 Jun 2020 at 14:53, Claude Pache wrote: > > > Le 29 juin 2020 à 12:30, G. P. B. a écrit : > > > > Greetings internal, > > > > While reviving the "Permit trailing whitespace in numeric strings" RFC > [1] > > I didn't see Nikita's comment on Andrea's original PR which commented on > > th

Re: [PHP-DEV][RFC] Saner numeric strings

2020-06-29 Thread Claude Pache
> Le 29 juin 2020 à 12:30, G. P. B. a écrit : > > Greetings internal, > > While reviving the "Permit trailing whitespace in numeric strings" RFC [1] > I didn't see Nikita's comment on Andrea's original PR which commented on > the fact that we should get rid of the "leading-numeric string" conc

[PHP-DEV][RFC] Saner numeric strings

2020-06-29 Thread G. P. B.
Greetings internal, While reviving the "Permit trailing whitespace in numeric strings" RFC [1] I didn't see Nikita's comment on Andrea's original PR which commented on the fact that we should get rid of the "leading-numeric string" concept. Therefore, mostly due to time constraints, I've merge th