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
最后这个是指复杂的数组或对象显示时候的“深度”了。
建议继续学习:
- Xdebug使用指南 (阅读:3209)
- xdebug 配置,在这里备份下 (阅读:2339)
- Ubuntu 下为 PHP 添加 Xdebug 插件 (阅读:2329)
- 使用xdebug调试PHP 找出PHP程序的瓶颈 (阅读:2214)
- 前端开发中的性能那点事(一)巧用xdebug (阅读:2018)
扫一扫订阅我的微信号:IT技术博客大学习
- 作者:rethink 来源: 博客园-rethink log
- 标签: var_dump xdebug
- 发布时间:2009-11-09 13:30:04
- [682] Go Reflect 性能
- [26] 正态分布的前世今生(一)
- [17] rsync同步的艺术
- [16] Linux Used内存到底哪里去了?
- [14] 基于HTTP缓存轻松实现客户端应用的离线支持
- [14] Linux内存中的Cache真的能被回收么?
- [13] 我的git笔记
- [13] Cuckoo Filter:设计与实现
- [12] 在JavaScript中什么时候使用==是正
- [12] 关于RDS只读实例延迟分析