PHP Notes - debug
Thursday, October 5, 2006 6:12:31 PM
How to debug without a million edits on a million lines:
Insert a statement that checks for a var - if exist then print the debug message.
EG:
//$debug = 1; just uncomment to debug all lines with $debug.
function foo ($arg){
if ($debug) { echo 'error: ' . __LINE__ . ' ' . __FILE__}
}
Insert a statement that checks for a var - if exist then print the debug message.
EG:
//$debug = 1; just uncomment to debug all lines with $debug.
function foo ($arg){
if ($debug) { echo 'error: ' . __LINE__ . ' ' . __FILE__}
}




