ID: 39896 Updated by: [EMAIL PROTECTED] Reported By: poon dot fung at gmail dot com -Status: Assigned +Status: Bogus Bug Type: SimpleXML related Operating System: Windows XP PHP Version: 5.2.0 Assigned To: helly New Comment:
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Dupe of bug #38604 Previous Comments: ------------------------------------------------------------------------ [2006-12-20 10:20:42] poon dot fung at gmail dot com Description: ------------ The combination of simplexml and htmlspecialchars() creates massive memory leak. In a about 500k calls to htmlspecialchars() on a value in simplexml, it eats up over 1GB of memory. Reproduce code: --------------- $xml = simplexml_load_file('some_xml_file.xml'); $val = ''; for ($index=0; $index<10000000; $index++) { $val = htmlspecialchars($xml->title); } Expected result: ---------------- If you run the above script and watch Windows Task Manager, you will see memory usage continuous to go up non-stop. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39896&edit=1