|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-20 18:41 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 19:00:02 2025 UTC |
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.