Re: Make strtolower/strtoupper just do ASCII
| From: | Tim Starling | Date: | Wed, 22 Sep 2021 12:57:01 +0000 |
| Subject: | Re: Make strtolower/strtoupper just do ASCII | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116126@lists.php.net to get a copy of this message | ||
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 result of your change.
> - This would allow eliminating more dead code, and make code calling those functions (on
> constant arguments) faster by caching the resulting strings in opcache.
Thanks, I will do that.
> The function
zend_string_tolower can safely be used to
> efficiently convert strings to lowercase in a case-insensitive way.
> (zend_string_toupper hasn't been needed yet due to not yet having any use cases in
> php-src's internals, but could be added in such a PR)
I uploaded my work so far and made a PR. It already has
zend_string_toupper.
-- Tim Starling