Search code examples
debuggingintellij-ideaxdebug

How to adjust range cap of arrays while debugging


I'm working with PhpStorm v2023.2.1 and I'm currently debugging an array that has over 100 entries. But in the debugging menu it only shows the first 100 entries.

Is there a way to adjust the range of entries that are shown in the array?

I have seen this post IntelliJ Blog but it is outdated (from 2011). I searched in the settings for a field to adjust the range but with no success.


Solution

  • Although the settings are gone, in my copy of the latest version of PhpStorm (2023.1.4) will automatically paginate and retrieve all the elements in an array.

    It specifically automatically retrieves information for the other "pages". For example, this shows up in the log with the following script and breakpoint on the var_dump($a) call:

    <?php
    $a = [];
    for ( $i = 0; $i < 400; $i++ )
    {
        $b = new stdClass;
        $b->_id = $i;
    
        $a[] = $b;
    }
    
    var_dump($a);
    
    property_get -i 55 -n $a -d 0 -c 0 -p 1
    property_get -i 56 -n $a -d 0 -c 0 -p 2
    property_get -i 57 -n $a -d 0 -c 0 -p 3