I’m trying to get the line number of a DOMElement object in PHP – the documentation says DOMElement extends DOMNode which implements the getLineNo() method, however, when I try to use this method I get:
Fatal error: Call to undefined method DOMElement::getLineNo()
Upgrade to PHP 5.3 or higher, see the documentation. On a side note: dynamically added nodes (i.e. not in the XML document or string on load) will return
0.