PhP5 exception handling mechanism [1]-index in this article

Source: Internet
Author: User
Tags php basics

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.