How to Debug PHP code? How to debug some vague php syntax error?

I was getting the following error:

[Wed Feb 04 08:09:30 2009] [error] [client xxx.xxx.xxxx.xxx] PHP Parse error: syntax error, unexpected '<' in /sites/all/modules/views/views.module(542) : eval()'d code on line 1

 I wrote this code in view.module line 542 to debug:

$result = eval($view->view_args_php);

global $user;

if ($user->uid== 1){

 if ($result == FALSE){
print "ERROR CAUGHT ";
debug_print_backtrace();
exit;
}
}

 

This told me that there is a trouble with a view. I went and checked that view. There was some garbage in the argument section that had come because of FCKeditor. I corrected that and my error went away.