Author:Matt zandstra
Translation:Haohappy 04-8-20
Haohappy@msn.com
Intended audience
Introduction
Handle errors before PhP5
-Use die () or trigger_error ()
-Error mark returned
-Use pear to handle errors
PhP5 exception Mechanism
-Use the throw keyword
-Try-catch statement
-Handle multiple errors
-Custom exception type
-Exception Transfer
-More exception-related information
Summary
About the author
Intended audience
This article is intended for programmers who want to understand the PhP5 exception handling mechanism. You need to have a certain degree of object-oriented programming and PHP basics.
Introduction
This article focuses on various error handling methods. Here you can see multiple error handling methods in PhP4 and PhP5. PhP5 introduces an "exception mechanism", a new mechanism for error handling in the object system. As you will see, "exception" provides many advanced features than traditional error handling mechanisms.