Php exceptions

From wikinotes

Documentation

official docs https://www.php.net/manual/en/class.exception.php

Notes

throw new Exception("Division by zero");
try {
  // code that can throw exceptions
} catch(Exception $e) {
  // code that runs when an exception is caught
} finally {
  // code that always runs regardless of whether an exception was caught
}