DOMDocument programming: a lot of little dilemmas, how to solve them?
- by Peter Krauss
I need elegance and performance: how to decide by the "best implementation" for each DOM algorithm that I face. This simple "DOMNodeList grouper" illustrate many little dilemmas:
use iterator_to_array or "populate an array", when not all items need to be copied.
use clone operator, cloneNode method or import method?
use parentNode::method() or…