This code will turn php errors into exceptions:
<?php
function exceptions_error_handler($severity, $message, $filename, $lineno) {
throw new ErrorException($message, 0, $severity, $filename, $lineno);
}
set_error_handler('exceptions_error_handler');
?>
However since <?php set_error_handler()?> doesn't work with fatal errors, you will not be able to throw them as Exceptions.