Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
1. What type of error? (parsing, syntax, function, undefined, etc.)
2. Line number. If not there, maybe the lines before it.
3. a. If parsing or syntax error, let Zend Studio (or similar editor) reveal it.
b. If undefined variables, constants or functions,
I. check spelling
II. check declarations or initializations
III. check scope (if onlny included, check include statements
c. etc.
4. go to devnetwork.net (please tell me where it is.).
How about yours?
Last edited by harrisonad on Wed Aug 17, 2005 11:37 pm, edited 1 time in total.
Don't waste time debugging: test. With fine-grained unit tests telling you what went wrong, the scope of the problem is narrowed down to one small area of the code making it relatively quick and easy to deal with.
I generally have defined a config.php include file for all my sites configurations. In that I set a custom error handler that provides me with error msg, file name and the code at the error location in the file, atleast one line above & one below (with color-coding too, thanks to php for this )
In the "old days" (last month ) I did:
1. Read the error message, 99% of the time its an immediate quick fix
2. If not fixed, start adding liberal applications of print_r/echo/die to isolate the error
Now I'm trying to do it the Unit Test way that McGruff and others advocate.