Home  >  Article  >  Backend Development  >  What should I do if the php var dump does not display completely?

What should I do if the php var dump does not display completely?

藏色散人
藏色散人Original
2021-05-20 09:54:352237browse

Solution to the incomplete display of php var_dump: First find and open the php.ini file; then add the content as "xdebug.var_display_max_children=128..."; finally restart the apache service.

What should I do if the php var dump does not display completely?

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

The var_dump() function output in PHP is incomplete Problem

In the PHP development environment, after installing the xdebug module, the output results of var_dump() will be easier to view, but by default, the output results of var_dump() will change: too many array elements No longer displayed, the string variable will only display the first N characters, and deeper array elements will also be displayed as ellipses.

This will cause some inconvenience, but we can modify the php.ini configuration file to solve this problem.

In the xdebug node in php.ini, add or modify the following parameters

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

Among them:

xdebug.var_display_max_children is the maximum number of elements allowed to be displayed in an array

xdebug.var_display_max_data is the maximum number of bytes a string variable is allowed to display

xdebug.var_display_max_depth is the maximum number of dimensions an array is allowed to display

Finally restart the apache service.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What should I do if the php var dump does not display completely?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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