handle errors in PHP?

  • error_reporting()
  • try {} catch {} blocks
  • set_error_handler()
try {
throw new Exception("Error occurred!");
} catch (Exception $e) {
echo $e->getMessage();
}

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *