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?

  • Not really - it's the same deal as this unfortunately, extensive use of __get() and __set() in the entity classes can indeed make Devel pretty useless. var_dump() with XDebug installed (and configured to be very verbose) works well for me
    – Clive
    Mar 10, 2014 at 15:15
  • Please post your comment as an answer. It's not as pretty as dpm's krumo output but helped, so you deserve a credit :) Mar 10, 2014 at 15:38

3 Answers 3


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:


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

  • Looking forward to your integration. Awesome work! Mar 11, 2014 at 8:24

https://drupal.org/node/2034919 will care about this.

It first bring in a new library which somehow will be extendable so that drupal's own logic can be supported.


See what berdir wrote +


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.