My Opera is closing 3rd of March

A blog

^^^ hmm... jup that's what it is

Subscribe to RSS feed

PHP Notes - debug

,

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__}
}