How to debug or explore an unknown object or array too big for Drupal's debug()? I'm trying to see what variables I have available in a $vars object in a Views hook. Unfortunately, like many Drupal object, this one is huge and attempting to output it using the Drupal debug() function (with or without the 3rd boolean argument) causes the server to crash with an out of memory error. 

Note that this is after increasing the memory limit quite high, the memory limit isn't the problem here (UPDATE: I later discovered the array output was over 370 megabytes!).

What's the least intensive (fewest contrib modules, patches, custom code, 3rd party libraries etc) way to explore the contents of a Drupal object like this that's too big for Drupal's debug()?
Devel

Devel module provides dd() command which is very useful for dumping very large object. Just run dd($vars) in the middle of code, it'll dump any object to the temporary file in your Drupal temp folder (temporary://drupal_debug.txt).



XDebug

Use XDebug PHP extension, so var_dump() will be replaced by xdebug_var_dump() so your big dump won't consist circular dependencies and would be limited only by specific depth.



Alternatively use TVarDumper, array_slice, serialize or json_encode, so check below for further details:


Using print_r and var_dump with circular reference at SO