技术头条 - 一个快速在微博传播文章的方式     搜索本站
您现在的位置首页 --> PHP --> xdebug: var_dump函数设置

xdebug: var_dump函数设置

浏览:2487次  出处信息

   在安装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

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

建议继续学习:

  1. Xdebug使用指南    (阅读:3206)
  2. xdebug 配置,在这里备份下    (阅读:2334)
  3. Ubuntu 下为 PHP 添加 Xdebug 插件    (阅读:2327)
  4. 使用xdebug调试PHP 找出PHP程序的瓶颈    (阅读:2207)
  5. 前端开发中的性能那点事(一)巧用xdebug    (阅读:2013)
QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
© 2009 - 2024 by blogread.cn 微博:@IT技术博客大学习

京ICP备15002552号-1