#46752 [Com]: str_replace / str_ireplace memory leak
| From: | crrodriguez at opensuse dot org | Date: | Sat, 06 Dec 2008 15:57:08 +0000 |
| Subject: | #46752 [Com]: str_replace / str_ireplace memory leak | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131682@lists.php.net to get a copy of this message | ||
ID: 46752
Comment by: crrodriguez at opensuse dot org
Reported By: daniel dot konopka at gmail dot com
Status: Open
Bug Type: Strings related
Operating System: Linux CentOS
PHP Version: 5.2.6
New Comment:
There is no memory leak and your code is wrong, anyway..
Previous Comments:
------------------------------------------------------------------------
[2008-12-04 23:29:10] daniel dot konopka at gmail dot com
Description:
------------
str_replace and str_ireplace cause a memory leak
Reproduce code:
---------------
$chars_ph = array('-');
$chars_rep = array('045]');
$subject = 'Programmable 15-Bar Pump-Espresso Coffee Machine';
$i = 0;
do {
$subject = str_replace($chars_rep, $subject);
++$i;
}
while ($i<100000);
Actual result:
--------------
Php script execution stops after exceeding php memory pool.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46752&edit=1