【问题标题】:Sublime Debugging with Xdebug - Array使用 Xdebug 进行 Sublime 调试 - 数组
【发布时间】:2013-06-05 11:38:19
【问题描述】:

目前我已经设置了 xdebug 和 sublime,但是在调试时我无法找出数组值。当前的调试视图将是

$current_user->roles [array] = 
$current_user->allcaps [array] = 
$current_user->filter [null] = 
$id [int] = 12
$postsByAuthor [array] = 
$wpdb [object] = 

但是数组肯定包含值。是否有用于更深入地查看数组值的 XDebug 设置?我没有更改 XDebug 的默认设置。

【问题讨论】:

    标签: php sublimetext2 xdebug


    【解决方案1】:

    工具 > XDebug > 设置 - 默认

    // Maximum amount of nested levels to retrieve
    // of array elements and object properties.
    "max_depth": 1
    

    【讨论】:

      【解决方案2】:

      Xdebug 没有这方面的设置,但它是 IDE (Sublime) 在与 Xdebug 通信时可以设置的。该协议允许通过 DBGp 协议中的 property_get 和 property_value 命令获取更深的元素:http://www.xdebug.org/docs-dbgp.php#properties-variables-and-values,也可以通过协议设置默认深度级别(使用 max_depth 功能:http://www.xdebug.org/docs-dbgp.php#feature-names)。

      Sublime 中可能有一个选项允许您更改默认值,但没有安装 Sublime,我无法确认。

      【讨论】:

      • 很高兴在 SO 上有 xdebug 的终极知识资源 :)
      猜你喜欢
      • 1970-01-01
      • 2012-11-18
      • 2020-03-23
      • 2015-07-04
      • 2011-06-19
      • 2022-01-22
      • 2014-06-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多