find out object properties passed to a function which is the best way of debugging codes in drupal?
for instance in election module there is a submodule called conditions, and there is a function:

function election_example_conditions_access_gmail($post, $account) {
  if ($account-&gt;uid == 0) {
    return FALSE;
  }
  return (bool) preg_match('/g(oogle)?mail\.com$/i', $account-&gt;mail);
}


in the above code, what is the easiest and fastest way to find out what is the $account object passed to function?
You can make use of the devel module for debugging.

Download and install the latest version of the Devel module.

dpm()
Prints a variable to the ‘message’ area of the page using 

dvm()
Uses var_dump() to print a variable to the ‘message’ area of the page 

So in your situation in your function use dpm($account)

function election_example_conditions_access_gmail($post, $account) {
   dpm($account)
  if ($account-&gt;uid == 0) {
    return FALSE;
  }
  return (bool) preg_match('/g(oogle)?mail\.com$/i', $account-&gt;mail);
}


and go to the page normally and you should see the debug backtrace appear in the message area