[xdebug-general] Re: How to access the original var_dump()?

From: Sean Coates <sean[@]caedmon.net>
Date: Sat, 10 Mar 2007 22:59:11 -0500

> My question is if there is any way to get access to the original
> var_dump() return value? Or would it be possible to implement a function
> to XDebug that returns this without modifications (e.g.
> xdebug_original_var_dump())? This would allow to use both tool at the
> same time with no limitations.

You should be using var_export or serialize for this:

sean[@]sarcasm:~$ php -r 'class Foo { private $bar = "mwahahaha"; } $Foo =
new Foo(); echo serialize($Foo) ."\n"; var_export($Foo); echo "\n";'
O:3:"Foo":1:{s:8:"Foobar";s:9:"mwahahaha";}
Foo::__set_state(array(
   'bar' => 'mwahahaha',
))

Better yet: http://php.net/reflection

(sorry for the re-send. stupid Thunderbird Virtual Identity plugin)

S
Received on Sun Mar 11 2007 - 04:59:21 GMT

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST