PHP Error Handling _php Tutorial

Source: Internet
Author: User

PHP Error Handling


PHP Error handling Error Classification: syntax error: The program can not run, direct prompt syntax error run-time error: Only the program to run to a row, or in a particular case to run the error will occur. Logic error: The program ran from start to finish without (and prompting) the error, but the result of the program run calculation is incorrect. The main thing programmers face and the error to handle is a run-time error. Wrong rating: in PHP, various errors are categorized, divided into approximately more than 10 levels based on the different critical programs and the sources (mechanisms) that are generated. Each level of error corresponds to an internal name-system constant! System error: E_error system Critical Error (one occurs, the program stops executing immediately.) This error is generally expected to be resolved immediately) e_warning system Warning (one occurs, prompts for errors, and continues execution.) Usually this error is expected to be dealt with "next business day" E_parse syntax error (one occurs, an error is indicated, and the code does not run at all – check the syntax before running. E_notice system Prompt (one occurs, prompts for errors, and continues execution.) Send an e-mail notice, oneself schedule time to solve. What is the nature of them? echo "
E_error = ". E_error;echo "
e_warning = ". E_warning;echo "
E_parse = ". E_parse;echo "
E_notice = ". E_notice; The results of the output are: E_error = 1e_warning = 2e_parse = 4e_notice = 8 visible They are just a constant within the system (integer constants); in fact, these constants (codename) are identifiers that we "control" for such errors. User-defined error: Only three: E_user_error e_user_warning E_user_notice We can create (generate) errors ourselves in the program--errors created for some unreasonable cases of data such as: Let the user fill in the age, Fill 18 is OK, but fill 188, it is unreasonable-from the digital point of view itself is no problem of other errors: E_all represents all errors-indicates that it can "include" all errors. E_strict represents a "strict" syntax check error--a syntax that can be executed, but is not welcome in the current PHP version.

http://www.bkjia.com/PHPjc/1072247.html www.bkjia.com true http://www.bkjia.com/PHPjc/1072247.html techarticle PHP error handling PHP error handling Error Classification: syntax error: The program cannot run, direct prompt syntax error run-time error: Only the program to run to a line, or in a particular situation ...

  • 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.