• home
  • Email: trainings@synapseindia.careers

Blogs

back

PHP EXCEPTIONAL HANDLING

Oct 16, 2015

PHP 5 has an exception model similar to that of other programming languages.By using try and catch block concept we can handle or customize error in a better way. <?php try { $error = ‘Always throw this error’; throw new Exception($error); // Code following an exception is not executed. echo ‘Never executed’; } catch (Exception $e) { echo ‘Caught exception: ‘, $e->getMessage(), “\n”; } // Continue execution echo ‘Hello World’; ?>

SynapseIndia (CEO: Shamit Khemka)

Leave a Reply

Your email address will not be published.