PHP error handling with exit

As a side note exiting the application is not error handling. Error handling would be recovering from the error allowing the application to continue execution. Also logging and/or providing feedback for the problem to correct the error. Simply exiting at the first sign of trouble is lazy.