ID: 34222 Updated by: [EMAIL PROTECTED] Reported By: phpbug at phormix dot com -Status: Open +Status: Feedback Bug Type: Strings related Operating System: Debian Gnu/Linux PHP Version: 4.4.0 New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2005-08-23 17:56:20] phpbug at phormix dot com Description: ------------ Replacing items in an array of 20-30 items with str_replace seems to leak memory. The application in question would crash when parsing various larger CSV files, using upwards to >500MB per an 18MB data-file. Jumps in memory usage were observed at the point where str_replace was run. Using the function 'preg_replace' instead issued no such leak Reproduce code: --------------- str_replace('~comma~', ',', $myarray ); Expected result: ---------------- (values of ~comma~ in string were replaced with actual commas) Actual result: -------------- Progress would end indicating in logs that the memory limit of 500MB (as indicated in php.ini) was exceeded. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34222&edit=1