error

How to debug Drupal or ... How I fell in love with the debug() function

Let's say you see recurring error messages in your db log file and you want to try and pinpoint the issue to be able to apply a fix.
So, how do you go about debugging your code?

Well, there are many different ways. You could go old-school and use

var_dump();

or

print_r();

.
Or you could go a step further and use

debug_backtrace();

to try and pinpoint the source of the error.

Subscribe to RSS - error