Home >Backend Development >PHP Tutorial >Solution to the problem that var_dump() cannot input variable content after installing xdebug in PHP_PHP Tutorial
Someone asked why var_dump() cannot input variable contents after PHP installs xdebug. The variables inside are output directly instead of outputting the contents of the variables. Now we only need to simply configure xdebug to solve the 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: excessive array elements will no longer be displayed. String variables will only display the first N characters, and deeper array elements will also be displayed as ellipses. This will cause some inconvenience. We modify the configuration file and set these.
In the xdebug node in php.ini, add the following
xdebug.var_display_max_children=128
xdebug.var_display_max_data=512
xdebug.var_display_max_depth=5
The detailed introduction is as follows, among which
xdebug.var_display_max_children = 128
Parameter type integer, default value is 128
Displays the maximum number of object attributes. The extra ones will not be displayed
xdebug.var_display_max_data = 512
Parameter type integer, default value 512
Maximum length of displayed data
xdebug.var_display_max_depth = 3
Rigel type integer, the default value is 3
Display the maximum number of nesting levels