How to get xdebug var_dump to show full object/array
To get xdebug to show the full contents of an object or array when using the var_dump
function, you can use the xdebug.var_display_max_depth
setting in your php.ini
file.
Here is an example of how you can set this setting:
xdebug.var_display_max_depth = 10
This will make xdebug display up to 10 levels deep for arrays and objects. You can adjust the value to your liking.
You can also use the xdebug_var_dump
function instead of var_dump
, which has a similar behavior as var_dump
, but also includes the xdebug settings.
For example:
xdebug_var_dump($object);
This will use the xdebug.var_display_max_depth
setting to determine how many levels deep to display the contents of the object or array.