php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54302 var_dump truncates values with no option to output all values
Submitted: 2011-03-18 09:57 UTC Modified: 2011-03-18 10:02 UTC
From: php at falconfour dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.3.6 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at falconfour dot com
New email:
PHP Version: OS:

 

 [2011-03-18 09:57 UTC] php at falconfour dot com
Description:
------------
Simple as that... after var_dump() decides "enough is enough", it just arbitrarily 
cuts off the rest of the value with ellipses.

Seriously annoying when trying to debug a script (the only time I use var_dump - 
what other purpose does it serve in production?)... it produces a nice HTML 
output, but 

Test script:
---------------
$test = array('foo');
$test['foo'] = array('bar');
$test['foo']['this'] = array('that');
$test['foo']['this']['where'] = array('there');
$test['foo']['this']['where']['your'] = array('face');
$test['foo']['this']['where']['your']['mom'] = array('fat');

var_dump($test);

Expected result:
----------------
<pre class='xdebug-var-dump' dir='ltr'>
<b>array</b>
  0 <font color='#888a85'>=&gt;</font> <small>string</small> <font 
color='#cc0000'>'foo'</font> <i>(length=3)</i>
  'foo' <font color='#888a85'>=&gt;</font> 
    <b>array</b>
      0 <font color='#888a85'>=&gt;</font> <small>string</small> <font 
color='#cc0000'>'bar'</font> <i>(length=3)</i>
      'this' <font color='#888a85'>=&gt;</font> 
        <b>array</b>
          0 <font color='#888a85'>=&gt;</font> <small>string</small> <font 
color='#cc0000'>'that'</font> <i>(length=4)</i>
          'where' <font color='#888a85'>=&gt;</font> 
            <b>array</b>
              0 <font color='#888a85'>=&gt;</font> <small>string</small> <font 
color='#cc0000'>'there'</font> <i>(length=5)</i>
              'your' <font color='#888a85'>=&gt;</font> 
                <b>array</b>
                  0 <font color='#888a85'>=&gt;</font> <small>string</small> 
<font color='#cc0000'>'face'</font> <i>(length=4)</i>
                  'mom' <font color='#888a85'>=&gt;</font> 
                    <b>array</b>
                      0 <font color='#888a85'>=&gt;</font> <small>string</small> 
<font color='#cc0000'>'fat'</font> <i>(length=3)</i>
</pre>

Actual result:
--------------
<pre class='xdebug-var-dump' dir='ltr'>
<b>array</b>
  0 <font color='#888a85'>=&gt;</font> <small>string</small> <font 
color='#cc0000'>'foo'</font> <i>(length=3)</i>
  'foo' <font color='#888a85'>=&gt;</font> 
    <b>array</b>
      0 <font color='#888a85'>=&gt;</font> <small>string</small> <font 
color='#cc0000'>'bar'</font> <i>(length=3)</i>
      'this' <font color='#888a85'>=&gt;</font> 
        <b>array</b>
          0 <font color='#888a85'>=&gt;</font> <small>string</small> <font 
color='#cc0000'>'that'</font> <i>(length=4)</i>
          'where' <font color='#888a85'>=&gt;</font> 
            <b>array</b>
              ...
</pre>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-18 10:02 UTC] aharvey@php.net
-Status: Open +Status: Bogus
 [2011-03-18 10:02 UTC] aharvey@php.net
This is something XDebug does, not PHP. I'd suggest reporting it on the
XDebug issue tracker.
 [2012-12-06 01:06 UTC] jazz at funkynerd dot com
This is an xdebug thing.  To remove the truncted output do this in your xdebug.ini or php.ini file:

xdebug.var_display_max_data=-1
xdebug.var_display_max_children=-1
xdebug.var_display_max_depth=-1
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 06:01:26 2024 UTC