PHP - try and catch block (Exception) handling -


i'm in doubt exception handling.

if have function foo(); same if handle this:

try {     foo(); } catch (exception $e) {     // someting } 

or if in function this:

foo() {     try {        // function body     } catch (exception $e) {        // someting     } } 

and if not throw exception ? code continue execute if error appears ?

yes, code continue. in php exists errors , exceptions. can handle errors function set_error_handler(), handle uncathable exceptions function set_exception_handler() , can handle exceptions using try .. catch


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -