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

自作多情 提交于 2019-12-31 05:46:06

问题


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?


回答1:


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().



来源:https://stackoverflow.com/questions/18714241/how-to-runtime-disable-xdebugs-var-dump-and-errors-prettify

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!