<?php

function error_handler( $errno, $errmsg, $filename, $linenum, $vars ) {
		// error was suppressed with the @-operator
		if ( 0 === error_reporting() )
			return false;

		if ( $errno !== E_ERROR )
			throw new \ErrorException( sprintf('%s: %s', $errno, $errmsg ), 0, $errno, $filename, $linenum );

}
set_error_handler( 'error_handler' );

try {
	$a[1250000000]='b'; // Это поймать надо
	$b=1/0; // и это
} catch (Exception $e) {
	echo 'Caught exception: ',  $e->getMessage(), "\n";
}