IMSoP / simplexml_debug

Tools for debugging your code when working with PHP's SimpleXML functions.
MIT License
52 stars 16 forks source link

Handle arrays returned by ->xpath() #1

Open IMSoP opened 12 years ago

IMSoP commented 12 years ago

The xpath() method doesn't return a SimpleXMLElement, but an actual array of objects. simplexml_dump() will currently return an error if you try to pass it this array.

Keeping this limitation keeps the function simple as it always gets a single SimpleXMLElement object, and doesn't need to do any recursion or similar. However, it means that not every SimpleXML operation can be trivially debugged with this function.

Would need to consider how to handle completely unrelated data types, including arrays with some SimpleXMLElement values as well as some others: