Class for error control for PHP