In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "PHP error message function description", the explanation content in the article is simple and clear, easy to learn and understand, please follow the small series of ideas slowly in-depth, together to study and learn "PHP error message function description" bar!
All error reporting messages in PHP can be set using the error_reporting() function:
Its parameters are expressed in two ways: character string and number. There are 14 levels in total. However, I think it seems possible to use other numbers. At first, I thought it meant a certain error interval. Later, I finally found the law:
The copy code is as follows:
error_reporting( 7 ) = error_reporting( 1+2+4)= error_reporting(E_ERROR | E_WARING | E_PARSE)
Now, I summarize it as follows:
Numeric constant 1E_ERROR fatal error, script execution interrupted, that is, there is something unrecognized in the script
Error: Invalid parameters. Invalid parameter name2E_WARNING Some code errors, but do not affect the overall operation
For example: Warning: require_once(E:/include/config_base.php)4E_PARSE characters, variables, or the end of the place to write specification error
Example: Parse error: syntax error, unexpected $end in8E_NOTICE General notification, such as variable undefined, etc.
Example: Notice: Undefined variable: p in E:\web\index.php on line 1716E_CORE_ERRORA fatal error occurred when the PHP process started
Example: No 32E_CORE_WARNING warning at PHP startup (non-fatal error)
Example: No 64E_COMPILE_ERROR compile fatal error
Example: No 128E_COMPILE_WARNING compile warning level error
Example: No user-defined error message 256E_USER_ERROR
Example: No user-defined warning message for 512E_USER_WARNING
Example: No user-defined reminder message for 1024E_USER_NOTICE
For example: there is no error message above 2047E_ALL, but not E_STRICT error message
For example, there is no 2048E_STRICT code standardization warning, allowing PHP to suggest how to modify the code to ensure optimal interoperability forward compatibility.
The default value for error_reporting is E_ALL & ~E_NOTICE
For development, the best value is E_ALL| E_STRICT
If set to: error_reporting(E_ALL| E_STRICT) means that all error messages are recorded
This can lead to a lot of error code on the website; but it should be said that it is a good thing for programmers to optimize the code; some non-fatal errors do not affect the operation of the program, but they will increase the burden of PHP.
Finally, print out the English version of the comparison table:
1E_ERRORFatal run-time errors. Errors that can not be recovered from. Execution of the script is halted2E_WARNINGNon-fatal run-time errors. Execution of the script is not halted4E_PARSECompile-time parse errors. Parse errors should only be generated by the parser8E_NOTICERun-time notices. The script found something that might be an error, but could also happen when running a script normally16E_CORE_ERRORFatal errors at PHP startup. This is like an E_ERROR in the PHP core32E_CORE_WARNINGNon-fatal errors at PHP startup. This is like an E_WARNING in the PHP core64E_COMPILE_ERRORFatal compile-time errors. This is like an E_ERROR generated by the Zend Scripting Engine128E_COMPILE_WARNINGNon-fatal compile-time errors. This is like an E_WARNING generated by the Zend Scripting Engine256E_USER_ERRORFatal user-generated error. This is like an E_ERROR set by the programmer using the PHP function trigger_error()512E_USER_WARNINGNon-fatal user-generated warning. This is like an E_WARNING set by the programmer using the PHP function trigger_error()1024E_USER_NOTICEUser-generated notice. This is like an E_NOTICE set by the programmer using the PHP function trigger_error()2048E_STRICTRun-time notices. PHP suggest changes to your code to help interoperability and compatibility of the code4096E_RECOVERABLE_ERRORCatchable fatal error. This is like an E_ERROR but can be caught by a user defined handle (see also set_error_handler())8191E_ALLAll errors and warnings, except level E_STRICT (E_STRICT will be part of E_ALL as of PHP 6.0) Thank you for reading, the above is the content of "PHP error message function description", after learning this article, I believe that we have a deeper understanding of PHP error message function description, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.