Home > Backend Development > PHP Problem > What are the PHP error level constants?

What are the PHP error level constants?

青灯夜游
Release: 2023-02-27 10:38:01
Original
4372 people have browsed it

What are the PHP error level constants?

In the process of PHP programming, everyone will definitely encounter more or less error reminders. It is these error reminders that guide us to write cleaner code. When PHP is running, different prompts will be given for errors of different severity.

php error level constant:

##516E_CORE_ERROR Fatal error during initialization during PHP startup. 632E_CORE_WARNINGWarning during initialization during PHP startup (non-fatal error) . 764E_COMPILE_ERROR Fatal error during compilation. This is like an E_ERROR being generated by the Zend scripting engine. 8128E_COMPILE_WARNINGCompilation time warning (non-causing error ). This is like an E_WARNING warning generated by the Zend script engine. 9256E_USER_ERROR Custom error message. Like using the PHP function trigger_error (programmer sets E_ERROR) 10512E_USER_WARNING Custom warning message. Like using the PHP function trigger_error (E_WARNING warning set by the programmer) 11 1024E_USER_NOTICECustomized reminder message. Like by using PHP function trigger_error (programmer E_NOTICE set) 122048E_STRICTEncoding standardization warning. Allows PHP to suggest code modifications to ensure optimal interoperability and forward compatibility. 134096E_RECOVERABLE_ERROR

Value Constant Description
1 1 E_ERROR
Fatal runtime error. The error cannot be recovered and execution of the script is suspended.
2 2 E_WARNING
Run-time warning (non-fatal error). Non-fatal runtime error, script execution will not stop.
3 4 E_PARSE
Compile time parsing error. Parsing errors are generated only by the parser.
4 8 E_NOTICE
Runtime reminders (these are often the Caused by bugs, it may also be caused by intentional behavior.)


















Fatal errors that can be caught. It indicates that a potentially dangerous error has occurred, but has not caused the PHP engine to become unstable. If the error is not caught by a user-defined handler (see set_error_handler()), it will become an E_ERROR and the script will terminate.
14 8191
E_ALL
Runtime notification. When enabled, a warning will be given about code that may not work properly in future versions.
15 16384
E_USER_DEPRECATED
User-generated warning message. Similar to E_DEPRECATED, but is generated by the user using the PHP function trigger_error() in the code.
16 30719
E_ALL
E_STRICT All error and warning messages.

For more PHP related knowledge, please visit php中文网!

The above is the detailed content of What are the PHP error level constants?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template