On 11/02/2014 18:29, Crypto Compress wrote:
Imagine a proxy object (orm).
Usecase #1: end-user
Sees only proxied object. No cluttered object graph. Very useful!
Usecase #2: new maintainer
Hunting bug in proxy object. No way to dump internals at all. Wait what?
On the other hand, usecase #3: hunting bug in incredibly complex object and "can't see the wood for the trees" because object graph fills pages of output.
Temporarily (re-)implement __debugInfo() to output a few relevant properties, and all becomes much clearer. I could have used this earlier today, in fact; I ended up with something like dump( array($this->foo, $this->bar, $this->baz) )
There might be merit in a way of viewing the "real" contents of an object, I guess, although that doesn't have any meaning for objects exposed by extensions anyway, as they can overload in ways user-land can only dream of. (Hence SimpleXML being so confusing if you try to debug it as though it were a "real" object.)
--
Rowan Collins
[IMSoP]