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.
var_dump has *no* recursion check unlike print_r