simplexml_debug
simplexml_debug copied to clipboard
output formatting
very nice
It would be nice if its output was more matched to var_dump
datatype(length) value
for example
string(5) "item1"
as opposed to
(string) 'item1' (5 chars)
// var_dump output
object(SimpleXMLElement)#4 (1) {
["item"]=>
string(5) "item1"
}
also if you pass a custom class to it, it is not reflected in output
// simplexml_load_string($xml, 'SimpleXMLExtended')
// var_dump output
object(SimpleXMLExtended)#4 (1) {
["item"]=>
string(5) "item1"
}
As of PHP 5.6, you can actually over-ride the behaviour of var_dump
et al by defining the __debugInfo
magic method, so I plan to rewrite this library on that basis.
If I can get a satisfactory format there, I will then try to implement it in PHP itself, so that the library becomes redundant.