Re: [RFC] [VOTE] __debugInfo()

From: Date: Tue, 11 Feb 2014 20:06:53 +0000
Subject: Re: [RFC] [VOTE] __debugInfo()
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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]

Thread (55 messages)

« previous php.internals (#72469) next »