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
Post a Comment