Example of error handling in OO PHP

The function below tests if a parameter value is passed. If not, it throws an exception.

Value was OK