xdebug: var_dump函数设置

在安装xdebug之后,php原来的var_dump方法会被改变,显示效果变得更加友好。

http://xdebug.org/docs/display 上的说明:

Xdebug replaces PHP's var_dump() function for displaying variables. Xdebug's version includes different colors for different types and places limits on the amount of array elements/object properties, maximum depth and string lengths. There are a few other functions dealing with variable display as well.

 虽然显示更加友好了,但是在默认的设置下,经常会使复杂的数组和对象不能完整的显示。反而不利于我们调试。此时,只要在程序中动态修改下面三个值就可以了:

ini_set('xdebug.var_display_max_children', 128 );//xdebug.var_display_max_children Type: integer, Default value: 128

ini_set('xdebug.var_display_max_data', 512 );//Type: integer, Default value: 512

ini_set('xdebug.var_display_max_depth', 3);//Type: integer, Default value: 3

最后这个是指复杂的数组或对象显示时候的“深度”了。 

 

 

posted @ 2009-10-28 11:28  rethink  阅读(1123)  评论(1编辑  收藏  举报