IMSoP / simplexml_debug

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

output formatting #9

Open tablatronix opened 9 years ago

tablatronix commented 9 years ago

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"
}
IMSoP commented 3 years ago

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.