10
class MyException extends Exception implements Catchable
12
function __construct($errstr, $errno, $errfile, $errline)
14
parent::__construct($errstr, $errno);
15
$this->file = $errfile;
16
$this->line = $errline;
20
function Error2Exception($errno, $errstr, $errfile, $errline)
22
throw new MyException($errstr, $errno, $errfile, $errline);
25
$err_msg = 'no exception';
26
set_error_handler('Error2Exception');
30
$con = fopen('/tmp/a_file_that_does_not_exist','r');
10
class MyException extends Exception implements Catchable
12
function __construct($errstr, $errno, $errfile, $errline)
14
parent::__construct($errstr, $errno);
15
$this->file = $errfile;
16
$this->line = $errline;
20
function Error2Exception($errno, $errstr, $errfile, $errline)
22
throw new MyException($errstr, $errno, $errfile, $errline);
25
$err_msg = 'no exception';
26
set_error_handler('Error2Exception');
30
$con = fopen('/tmp/a_file_that_does_not_exist','r');