May 2003
Intermediate to advanced
592 pages
14h 28m
English
Debugging a PHP script—debugging it efficiently, at least—boils down to understanding the normal causes of errors. Table 9.1 lists the likely reasons for the most common PHP errors.
| Common PHP Errors | |
|---|---|
| ERROR | LIKELY CAUSE |
| Parse error | Missing semicolon, unbalanced curly braces, parentheses, or quotation marks, or use of an unescaped quotation mark in a string. |
| Empty variable value | Forgot the initial $, misspelled or miscapitalized the variable name, inappropriate variable scope, or the register_globals setting is turned off. |
| Undefined variable | Reference made to a variable before it is given a value. |
| Call to undefined function ... | |