Sara Golemon wrote (on 05/02/2014):
(such as current uses in dom,
sxe, mysqli, intl, and spl)
If "sxe" in there means SimpleXML, I wish it would do a better job of it!
There are countless questions on StackOverflow, and comments in the PHP manual, confused by its mention of "array", "@attributes", etc, and the fact that it omits CDATA nodes, any text node with a non-text sibling, anything in a namespace, etc, etc
e.g. http://3v4l.org/h6KeF
In fact, now that I know this hook exists, and doesn't affect the action of array casts, I'm tempted to attempt a patch that would improve it, based on the simplexml_tree function I've written at https://github.com/IMSoP/simplexml_debug
I guess even if I don't get good enough at C hacking, I could write a version using this new user-land callback :)
It's a shame it can't (AIUI) return a completely pre-formatted string, so that complex objects wouldn't have to pretend to contain arrays in order to represent nested properties.
--
Rowan Collins
[IMSoP]