How to debug a variable in a controller class (var_dump) I am trying to do a var dump from a Drupal 8 Controller class. This is not working because controllers need to send a response. I just need to see the contents of a variable and I have not idea how to do this since I've tried all response combinations and can't seem to get it working.

This is my variable.

$storage = \Drupal::entityTypeManager()-&gt;getStorage('node');
$node = $storage-&gt;load($rep_id);


I am trying to var_dump($node) to see what's in it. Can anyone help?
OK, I'm going to be that guy. Do yourself a favour and set up Xdebug, hacks like var_dump() or var_export() are very bad practice and sooner or later you will forget to remove some of those statements and it will end up in production. Also it takes one single click to set up a breakpoint, as opposed to writing a var_dump()  or var_export() statement. Not to mention that the amount of information you can get by using a debugger is vastly more comprehensive.