Re: [RFC] [VOTE] __debugInfo()

From: Date: Wed, 05 Feb 2014 20:01:04 +0000
Subject: Re: [RFC] [VOTE] __debugInfo()
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Am 05.02.2014 19:38, schrieb Sara Golemon:
The existing get_debug_info behavior is always active and this RFC just lifts it up to the userspace level. Is there a specific use case for which you'd like that? I suppose you could always do: var_dump((array)$obj); and get the "real" prop info.
What info someone want to see is highly *context/situation and person dependent*. As i wrote i use __tostring extensively for this specific purpose. For 99% of the time i am happy with compact/trimmed output of importance and there is this other case (mostly urgent), to see the full state of the whole object graph (yeah, recursive too). The issue occurred is somewhat analogous with "escaping on input" or "private/protected discussion": - sanitize: information is missing on output - escape html: read garbage on command line/logs - private: can't change bad design easily (- it's not about security) Changing class definitions/methods of whole object graph is obviously not an option. Casting to array is of no help as only for current object and only for public props. Rephrased: Someone (my younger self :D) can decide what i do *not* need to see in my logs/debug-output and there would be no easy/fast way to bypass. cryptocompress

Thread (55 messages)

« previous php.internals (#72289) next »