Re: [RFC] [VOTE] __debugInfo()

From: Date: Wed, 05 Feb 2014 18:38:52 +0000
Subject: Re: [RFC] [VOTE] __debugInfo()
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-72285@lists.php.net to get a copy of this message
On Tue, Feb 4, 2014 at 3:47 AM, Crypto Compress <cryptocompress@googlemail.com> wrote: > 1. Can this hook be bypassed or disabled (global/temporary)? > e.g. real_var_dump(), ini setting, some other flag? > No. 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. In practice, an object would use this hook to provide better info, keeping implementation details out of the way (such as current uses in dom, sxe, mysqli, intl, and spl). > 2. What will be affected by this hook beside "var_dump"? > e.g. xdebug output, var_export, ... > var_dump() and print_r() are the only current uses of get_debug_info > 3. How would this behave (segfault?): > public function __debugInfo() { var_dump($this); return []; } > Badly (most likely timeout or memory limit E_ERROR). Don't do that. -Sara

« previous php.internals (#72285) next »