How to get xdebug var_dump to show full object/array

前端 未结 6 1603
花落未央
花落未央 2020-11-27 08:57

I am using xdebug (php_xdebug-2.1.2-5.3-vc9.dll) on WAMP. When I use var_dump on a large object or variable it does not show the full variable.

         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 09:39

    These are configurable variables in php.ini:

    ; with sane limits
    xdebug.var_display_max_depth = 10
    xdebug.var_display_max_children = 256
    xdebug.var_display_max_data = 1024 
    
    
    ; with no limits
    ; (maximum nesting is 1023)
    xdebug.var_display_max_depth = -1 
    xdebug.var_display_max_children = -1
    xdebug.var_display_max_data = -1 
    

    Of course, these may also be set at runtime via ini_set(), useful if you don't want to modify php.ini and restart your web server but need to quickly inspect something more deeply.

    ini_set('xdebug.var_display_max_depth', '10');
    ini_set('xdebug.var_display_max_children', '256');
    ini_set('xdebug.var_display_max_data', '1024');
    

    Xdebug settings are explained in the official documentation.

提交回复
热议问题