Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-22 Thread Tim Starling
On 19/9/21 12:33 am, tyson andre wrote: > When implementing this, Zend/Optimizer/sccp.c has optimizations for functions > such as str_contains, etc to optimize. > After removing locale dependence, those optimizations could be safely added > for functions that would be locale independent as a resu

Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-22 Thread Tim Starling
On 19/9/21 12:33 am, tyson andre wrote: > When implementing this, Zend/Optimizer/sccp.c has optimizations for functions > such as str_contains, etc to optimize. > After removing locale dependence, those optimizations could be safely added > for functions that would be locale independent as a resu

Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-18 Thread tyson andre
Hi Tim Starling,   > I would like to know if a patch to make strtolower and strtoupper do > plain ASCII case conversion would be accepted, or if an RFC should be > created. > > The situation with case conversion is inconsistent. > > The following functions do ASCII case conversion: strcasecmp, >

Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-17 Thread Nikita Popov
On Fri, Sep 17, 2021 at 12:07 PM Tim Starling wrote: > On 17/9/21 7:15 pm, Kamil Tekiela wrote: > > +1 from me. I wasn't even aware that these functions are > > locale-dependent until recently. I see an added benefit that we could > > add them to the optimizer once they are no longer locale-depen

Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-17 Thread Pierre Joye
Hi Tim, hope you are well :) On Fri, Sep 17, 2021, 5:07 PM Tim Starling wrote: > > We could add a global mode, although that would prevent constant > propagation, if that's what you mean by adding them to the optimizer. > Or we could add variant functions like locale_strtolower() and > locale_

Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-17 Thread Christian Schneider
Am 17.09.2021 um 10:43 schrieb Nikita Popov : > The locale-sensitivity of strtolower() only works with legacy > single-byte encodings and as such is of questionable usefulness even in > cases where it is not actively harmful. > > That said, I do think this change requires an RFC. I agree that thi

Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-17 Thread Tim Starling
On 17/9/21 6:43 pm, Nikita Popov wrote: > We've been slowly moving away from locale-dependent functionality. > Since PHP 8 we no longer inherit any locales from the environment and > have made float to string conversion locale-independent. > > I would very much support making strtolower() and frie

Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-17 Thread Tim Starling
On 17/9/21 7:15 pm, Kamil Tekiela wrote: > +1 from me. I wasn't even aware that these functions are > locale-dependent until recently. I see an added benefit that we could > add them to the optimizer once they are no longer locale-dependent.  > What would happen to users who really need the locale-

Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-17 Thread Kamil Tekiela
+1 from me. I wasn't even aware that these functions are locale-dependent until recently. I see an added benefit that we could add them to the optimizer once they are no longer locale-dependent. What would happen to users who really need the locale-dependent functions? Do we offer some workarounds?

Re: [PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-17 Thread Nikita Popov
On Fri, Sep 17, 2021 at 4:59 AM Tim Starling wrote: > I would like to know if a patch to make strtolower and strtoupper do > plain ASCII case conversion would be accepted, or if an RFC should be > created. > > The situation with case conversion is inconsistent. > > The following functions do ASCI

[PHP-DEV] Make strtolower/strtoupper just do ASCII

2021-09-16 Thread Tim Starling
I would like to know if a patch to make strtolower and strtoupper do plain ASCII case conversion would be accepted, or if an RFC should be created. The situation with case conversion is inconsistent. The following functions do ASCII case conversion: strcasecmp, strncasecmp, substr_compare. The f