[php-src] Issue #9150: str_replace memory usage
| From: | xGrz | Date: | Tue, 26 Jul 2022 09:02:00 +0000 |
| Subject: | [php-src] Issue #9150: str_replace memory usage | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242025@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9150
Author: xGrz
### Description
str_replace takes a lot of memory when third parameter ($string) is null.
Processing 2k rows with $string = null:
str_replace(['PL', '-', ' '], '', $string);
took 22M memory
When $string != null; (for. ex. $string = ' ';) it tooks 10MB
memory.
### PHP Version
PHP 8.1.2
### Operating System
_No response_