simplexml_debug icon indicating copy to clipboard operation
simplexml_debug copied to clipboard

output formatting

Open tablatronix opened this issue 10 years ago • 1 comments

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"
}

tablatronix avatar Feb 05 '15 19:02 tablatronix

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.

IMSoP avatar Mar 15 '21 14:03 IMSoP