php - 如何在 xdebug 模式下启用输出突出显示?

标签 php xdebug

当我的 php.php 启用 xdebug 模式时,所有作为 var_dump 的输出结构都会变成彩色(红色、绿色)。

如何在没有 xdebug 模式的情况下启用此颜色?

最佳答案

每个设置都在Xdebug settings page上.

这就是您所需要的:

xdebug.cli_color = 2

xdebug.cli_color Type: integer, Default value: 0, Introduced in Xdebug > 2.2 If this setting is 1, Xdebug will color var_dumps and stack traces output when in CLI mode and when the output is a tty. On Windows, the ANSICON tool needs to be installed.

If the setting is 2, then Xdebug will always color var_dumps and stack trace, no matter whether it's connected to a tty or whether ANSICON is installed. In this case, you might end up seeing escape codes.

更新

遗憾的是,xDebug 引用的链接上不再有 ANSICON。您可以从here下载.

警告:对我来说,Comodo Internet Security 已将 .dll 文件标记为病毒,因此请留意它。

关于php - 如何在 xdebug 模式下启用输出突出显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37182282/

相关文章:

PHP 添加秒数

javascript - 奇怪的问题:jQuery AJAX 成功数据仅解析最后一个 JSON 节点

php - Zend_Paginator中如何限制分页链接的个数

javascript - 谷歌地图标记 php

xml - 如何轻松调试布局 Xml 警告/错误?

php - PHP 调试包的用途

php - 在mysql中插入双引号并打印出来,不带反斜杠

php - 在 Windows 上将 Xdebug 和 PhpStorm 与 Docker 容器一起使用

phpunit --path-coverage(分支覆盖)花费 100 倍以上的时间

laravel - 如何使用 Laradock 和 PhpStorm 配置 Xdebug