PHP Errors and ErrorManagement

Errors are an integral part of every computer language—although one that, most of the time, programmers would rather not have to deal with!

PHP has some excellent facilities for dealing with errors that provide an excellent level of fine-grained control over how errors are thrown, handled and reported.

Proper error management is essential to writing applications that are both stable and capable of detecting when the inevitable problem arises, thus handling failure in a graceful manner.

Types of Errors
There are several types of errors—usually referred to as error levels in PHP:

Compile-time errors Errors detected by the parser while it is compiling a script. Cannot be
trapped from within the script itself.
Fatal errors Errors that halt the execution of a script. Cannot be trapped.
Recoverable errors Errors that represent significant failures, but can still be handled in a
safe way.
Warnings Recoverable errors that indicate a run-time fault. Do not halt the execution of 
the script.
Notices Indicate that an error condition occurred, but is not necessarily significant. Do not 
halt the execution of the script.

Next Topic | Previous Topic

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail

2 Comments

  1. avatartuanict

    how to use error control in php? please show me tutorial for it.

  2. avataradmin (Post author)

    Hi tuanict,

    Possible the following links help you:
    1: http://www.phpmoot.com/using-the-error-control/
    2: http://www.phpmoot.com/operators/ (under Other Operators heading)
    3: http://www.phpmoot.com/php-function-to-format-debugging-messages/

    good luck…

Leave a Comment

Your email address will not be published. Required fields are marked *