Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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