1. Set your own error-handling function
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/83/CB/wKioL1d8qEmARWb-AABRRC0FX_o132.png-wh_500x0-wm_3 -wmp_4-s_994699171.png "title=" 00.png "width=" "height=" 368 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px; height:368px; "alt=" Wkiol1d8qemarwb-aabrrc0fx_o132.png-wh_50 "/>
Trigger_error () captures user-level errors. Set_error_handler () user-defined error handling function.
2. Catching exceptions
Catching exceptions of course with try{
A function with an exception is placed here, no exception, code continues execution, exception is triggered, an exception is thrown
}catch () {
}
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/83/CD/wKiom1d8qxzQ0tg6AACFYeo85U8447.png-wh_500x0-wm_3 -wmp_4-s_3882888638.png "title=" 01.png "alt=" Wkiom1d8qxzq0tg6aacfyeo85u8447.png-wh_50 "/>
Of course, the exception handling class used in the code is thinkphp, Throw_exception is the thinkphp throw exception function
In addition to the PHP error mechanism to add:
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/83/CD/wKiom1d8rhaAoODJAAGcl9UUM5Q257.png-wh_500x0-wm_3 -wmp_4-s_2956218205.png "title=" 02.png "alt=" Wkiom1d8rhaaoodjaagcl9uum5q257.png-wh_50 "/>
the value above (numeric or symbolic) is used to create a bits mask, To create the error message to report. You can use bitwise operators to combine these values or to mask some types of errors. note that in php.ini , only ' | ', ' ~ ', '! ', ' ^ ' and ' & ' will parse correctly.
This article is from "I want to be a Daniel" blog, please make sure to keep this source http://houhaibo.blog.51cto.com/10674676/1808953
PHP error handling and exception handling