Home > php教程 > php手册 > body text

php安装xdebug后var_dump()不能输变量内容解决办法

WBOY
Release: 2016-06-13 09:46:36
Original
1473 people have browsed it

有人问为什么php安装xdebug后var_dump()不能输变量内容呢,里面的变量都是直接输出而不是把变量中的内容输出呢,下面我们只要简单的配置一下xdebug即可解决了。

php开发环境里,安装了xdebug模块后,var_dump()输出的结果将比较易于查看,但默认情况下,var_dump() 输出的结果将有所变化:过多的数组元素不再显示,字符串变量将只显示前N个字符,较深的数组元素也被显示成省略号。这点会带来一些不便,我们修改配置文件,设置这些。

在php.ini里的xdebug节点中,加入如下

xdebug.var_display_max_children=128
xdebug.var_display_max_data=512
xdebug.var_display_max_depth=5

详细介绍如下,其中


xdebug.var_display_max_children = 128


参数类型integer,默认值为128


显示对象属性最多个数。多出的不显示

xdebug.var_display_max_data = 512


参数类型integer,默认值512
显示数据最大长度

xdebug.var_display_max_depth = 3

参宿类型integer,默认值为3
显示最大嵌套级数

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!