note 37874 deleted from function.domxml-open-mem by sobak
| From: | sobak@php.net | Date: | Tue, 22 Nov 2016 03:41:31 +0000 |
| Subject: | note 37874 deleted from function.domxml-open-mem by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207409@lists.php.net to get a copy of this message | ||
Note Submitter: ej at campbell *dot* name
----
The DOM XML parser does not automatically free memory when a DomDocument goes out of scope.
If you're using the DOM parser to parse several XML files as part of a long running script, you
must free the DomDocument manually or a memory leak will occur.
To free a DOM document allocated by domxml_open_mem, do the following:
$doc = domxml_open_mem("$contents");
$doc->free();