debugging

More De-bugging Hints

Robert Douglass has another good tip, for when you don't even know what variables are defined at a given scope. Use:

var_dump(get_defined_vars());

Robert's full post here.

Debugging Drupal: The Single Line Dump

When you're de-bugging in Drupal -- or any PHP application, for that matter -- you'll soon learn that print_r is one of your best friends. Soon thereafter, you'll learn that a variable/array/object dumped to the screen is much more readable when you place the output between a pair of <pre> tags. Three simple lines of PHP:

Syndicate content