> What i did was writing a function that simply throws an exception and > passing that function to set_error_handler, something like this: > > error_reporting(E_ALL); > function exceptionThrower($type, $errMsg, $errFile, $errLine) { > throw new Exception($errMsg); > } > set_error_handler('exceptionThrower');
You should check out: http://php.net/ErrorException It is an Exception type tailored to PHP's errors. Vincent de Lau vinc...@delau.nl