PHP 5 Debugging and Errors
An Errors is defined as an unexpected, invalid program state from which it is impossible to recover.
A code bug is normally a kind of syntactical, semantic, logical or runtime Errors.
Note: A large number of Errors can be reduced by using good programming practices.
PHP provide large number of options to deal with errors
Good programming practices
There are a few ways to help track down the problem in code keep the following point in mind while programming.
1. Visual examination of code spec.
The very first thing a programmer should do upon seeing an Errors message is to visually examine the source code that has an Errors.
Pay attention to the following three simple script and try to find Errors.
<?php echo "Errors handling!
<?php echo "Errors handling!;" ?>
<?php echo "Errors handling!"; ?>
In the first example there is no semicolon, in the second example there is an echo statement that is not terminated properly. After the termination, there is a double quote. So both are error full but the last example is terminated properly and error free.