Handling PHP errors with "Class"