Home  >  Article  >  Backend Development  >  Use of try catch in PHP

Use of try catch in PHP

little bottle
little bottleforward
2019-04-16 14:48:0210726browse

1.try catch can catch the exception thrown by the upper layer

2.finally is a block that will eventually be executed regardless of whether try or catch has a return block

3.try can also be used Catch the throw exception inside the call_user_func_array callback function class

4. call_user_func_array can only call the static method of the class, and you can create a new object in this static method

5. Without customizing anything In the case of error handling functions, try cannot capture errors in PHP itself, including notice warning error and other levels.

The following code is a part of the project, which has gone through multiple layers of calls and callbacks


【Course Recommendation: PHP Video Tutorial】 

The above is the detailed content of Use of try catch in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete