0

What are the differences of dpm and dsm for the devel module? I mainly use dsm for the devel module. What are some other common debugging functions that are useful in the devel module?

  • 1
    I answered "differences" part. "Some other common debugging functions" would render this question too broad in my eyes, consider removing it. Especially when it is already covered by demo page linked fom project page. – Mołot Oct 20 '14 at 18:09
  • Even that doc is a little wrong, as dpm() will normally use krumo and not print_r. – mpdonadio Oct 20 '14 at 18:47
2

From the documentation:

Legacy function that was poorly named.

Use dpm() instead, since the 'p' maps to 'print_r'.

Code

function dsm($input, $name = NULL) {
  return dpm($input, $name);
}

So there is no real difference, except the function you are using is left there for developers that failed to switch when it was renamed.

2

dpm() prints a variable to the ‘message’ area of the page using drupal_set_message(). The output and compact and less likely to break the layout of your page.

From the devel docs:

A note from the devel module: dsm() is a legacy function that was poorly named; use dpm() instead, since the 'p' maps to 'print_r'.

I think we should trust the devel folks on that one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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