PHP Basic Tutorial Common PHP error types and Shielding methods
Source: Internet
Author: User
As long as the program is running, there will inevitably be errors, errors are common, such as error,notice,warning and so on. This article brother even PHP training
Small series to tell you specifically about PHP error types and shielding methods. In
Php
, there are mainly the following 3 types of errors.
1. Note (notices)
These are small and not serious errors, such as accessing a variable that is not defined. Typically, this type of error is not prompted to the user, but sometimes these errors can affect the result of the run.
2. Warning (Warnings)
This is a slightly more serious mistake, such as wanting to include an include () file that does not exist itself. Such an error message will prompt the user, but will not cause the program to stop running.
3. Fatal error (Fatal errors)
These are serious errors, such as if you want to initialize an object that does not exist at all, or call a nonexistent function that causes the program to stop running, and PHP will show the error to the user.
Different types of errors include:
E_error: It is usually displayed, and the program execution is interrupted.
E_warning: It is usually displayed but does not interrupt the execution of the program.
E_notice: A code error occurred while the script was running correctly.
E_parse: Syntax parsing error.
E_core_error: A fatal error occurred while PHP was booting.
E_core_warning: Reports non-fatal errors that occur when PHP is started.
E_compile_error: A fatal error occurred at compile time, indicating a script error.
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