Is there a way to disable xdebug's var_dump temporarily?
Asked Answered
B

2

14

I want to use Zend_Debug::dump, to keep some variables in the log, but since I have xdebug installed, and xdebug replaces php's var_dump, my values in log are html values produced by xdebug.

I was wondering if there is a way in php to disable this feature, and enabled it again, so that I could put them above and below this line:

    $Message = Zend_Debug::dump($objects, null, false);
Baese answered 21/11, 2011 at 3:40 Comment(0)
R
13

Internally Zend_Debug uses var_dump, and AFAIK you can't turn off XDebug's var_dump overloading in runtime.

You can do two thing to get your output without html tags.

  1. Disable html_errors by ini_set('html_errors', 0) before dump.
  2. Instead of using Zend_Debug, use $Message = print_r($objects, true) - notice second parameter.
Ragamuffin answered 21/11, 2011 at 8:18 Comment(1)
Just a FYI comment, my favorite dump code : die('<pre>' . var_export($var, true));Icon
J
28

I had to add xdebug.overload_var_dump=off to php.ini to disable xdebug's overloading the var_dump() function, permanently for me.

Junkman answered 18/12, 2013 at 19:12 Comment(0)
R
13

Internally Zend_Debug uses var_dump, and AFAIK you can't turn off XDebug's var_dump overloading in runtime.

You can do two thing to get your output without html tags.

  1. Disable html_errors by ini_set('html_errors', 0) before dump.
  2. Instead of using Zend_Debug, use $Message = print_r($objects, true) - notice second parameter.
Ragamuffin answered 21/11, 2011 at 8:18 Comment(1)
Just a FYI comment, my favorite dump code : die('<pre>' . var_export($var, true));Icon

© 2022 - 2024 — McMap. All rights reserved.