How do I dump a variable that is too big for dump(var)? I am working with the views-view-unformatted.html.twig file, and I am trying to use the following code.

{{ dump(row.content | keys) }}


The returned value is the following.

/var/www/html/example_site/vendor/twig/twig/lib/Twig/Extension/Debug.php:60:
array (size=5)
  0 =&gt; string '#theme' (length=6)
  1 =&gt; string '#view' (length=5)
  2 =&gt; string '#options' (length=8)
  3 =&gt; string '#row' (length=4)
  4 =&gt; string '#field_alias' (length=12)


With {{ dump(row.content['#row'] | keys) }} I get the following.

/var/www/html/example_site/vendor/twig/twig/lib/Twig/Extension/Debug.php:60:
array (size=0)
  empty


Based on it being empty, I assume it is not an array and proceed to use {{ dump(row.content['#row']) }}. When I do this I get a 504 Gateway Timeout error. max_execution_time is set to 30.

How do I dump a variable that is too big for dump(var)?
As a workaround, until Kint will be configurable via UI see #2405179, edit modules/devel/kint/kint/config.default.php and set $_kintSettings['maxLevels'] to a lower number (the default is 7).

Try using 4. This will limit the depth of the array that gets dumped.