catch an iconv E_NOTICE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



i have this hack that works up to a point...

function my_err_handler($errno, $errstr, $errfile, $errline) {
    if ( preg_match('/iconv/', $errstr) ) {
        throw new Exception('iconv error');
    } else {
        // ? how to invoke default error handler ?
    }
}
set_error_handler("my_err_handler", E_NOTICE);

try {
    $s = iconv($enc1, $enc2, $s);
} catch (Exception $e) {
    // deal with the failed conversion
}

but i'd like proceed with default error handling in the branch with the
question marks. how can i do that?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux