Example explained:
The code above throws an exception and catches it:
The checkNum() function is created. It checks if a number is greater than 1. If it is, an exception is thrown
The checkNum() function is called in a "try" block
The exception within the checkNum() function is thrown
The "catch" block retrieves the exception and creates an object ($e) containing the exception information
The error message from the exception is echoed by calling $e->getMessage() from the exception object
However, one way to get around the "every throw must have a catch" rule is to set a top level exception handler to handle errors that slip through.