Drupal 8 devel dpm does not expand Drupal\node\Entity\Node I'm getting a feeling that Devel got pretty much useless with D8. When I try to dump most of the drupal objects I get only (Object) Namespace\Class output. No fields data is printed. print_r is able to print a lot of information but it's close to useless because it's output is virtually unreadable.

Is there a way to nicely print (dpm?) contents of objects in D8?
dpm() does not print any protected properties and it also doesn't know about methods. That's especially bad for content entities but applies to most objects in 8.x now.

The issue referenced in the answer from Daniel Wehner adds Kint, which is already much better, as it will give you protected properties and methods.

However, for content entities, it still won't be that helpful as the values are all within ->values and ->fields and it's not trivial to understand how those work, especially with multiple languages.

That's why we're also working on better integration for content entities with Kint, so that it will display the fields and their values, see the screenshot in that issue.

Until then, you can also always use the following to debug what's inside a node or other content entity:

&lt;?php
dpm($node-&gt;toArray());
dpm($node-&gt;getFieldDefinitions());
?&gt;


At least the first one also works well with debug(), which has the advantage that it also works when running tests.