ID: 39896
Updated by: [EMAIL PROTECTED]
Reported By: poon dot fung at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: SimpleXML related
Operating System: Windows XP
PHP Version: 5.2.0
-Assigned To:
+Assigned To: helly
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