Re: [PHP-DEV] DOMNodeList memory eating

2012-11-29 Thread Rob Richards
XPath returns a fully populated list of object based on the expression. getElementsByTagName accesses the nodes within the tree in real time as you iterate so you only have one object at a time unless you are persisting them. Different behavior due to who owns the data and its lifecycle. XPath

[PHP-DEV] DOMNodeList memory eating

2012-11-29 Thread Nicolai Scheer
Hi! Just stumbled upon a strange behaviour when iterating over DOMNodeLists. Before I open a bug report I'd like to ask if anyone can comment on this issue, maybe it's the excpected behaviour. Consider the following small script: x x x XML; $dom = new DOMDocument(); $dom->loadXML