Obito Uchiha
Obito Uchiha

Reputation: 123

How to runtime disable xDebug's var_dump and errors prettify?

I sometimes prefer to use

header("Content-type: text/plain");

Do not mess around with HTML. However, whenever an error occurs, or when I use var_dump(), it would issue a large HTML block to prettify the output. While it's great in HTML context, I would like to disable it when I work in text/plain.

Is it possible to do? Runtime disable of the prettify?

Upvotes: 2

Views: 2131

Answers (1)

Bere
Bere

Reputation: 1747

XDebug will show you an error if PHP HTML errors are enabled. You can do one of the following

  1. You can disable php errors from displayed.

    ini_set('display_errors', 0)

  2. Or you can change html_errors = On setting of php.ini for xdebug to html_errors = Off'

    ini_set('html_errors', 'off')

But you should know, you cannot prevent PARSE errors from appearing using ini_set().

Upvotes: 4

Related Questions