Re: [RFC] [VOTE] __debugInfo()

From: Date: Wed, 05 Feb 2014 17:05:24 +0000
Subject: Re: [RFC] [VOTE] __debugInfo()
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-72279@lists.php.net to get a copy of this message
On Wed, Feb 5, 2014 at 1:24 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: > Hi all, > > On Tue, Feb 4, 2014 at 10:16 PM, Tjerk Meesters <tjerk.meesters@gmail.com>wrote: > >> > some more questions: >> > >> > 1. Can this hook be bypassed or disabled (global/temporary)? >> > e.g. real_var_dump(), ini setting, some other flag? >> > >> > 2. What will be affected by this hook beside "var_dump"? >> > e.g. xdebug output, var_export, ... >> > >> > 3. How would this behave (segfault?): >> > public function __debugInfo() { var_dump($this); return []; } >> > >> >> Yeah, there doesn't seem to be any recursion protection, just like: >> >> public function __toString() { return (string)$this; } > > > It is the same as > > function f() { > f(); > } > > User may do that, but it's a documentation problem. > It would be not obvious as function call recursion. > and must be documented, probably. Yup, AFAIK, the only recursion calls we check against are in __get() and __set() handlers, that's all. I admit the __tostring() casting $this to string is tricky ;-) I suggest we dont implement recursion checks for debug_info neither. Julien.P

« previous php.internals (#72279) next »