downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

set_error_handler> <restore_error_handler
Last updated: Fri, 14 Aug 2009

view this page in

restore_exception_handler

(PHP 5)

restore_exception_handler Réactive l'ancienne fonction de gestion d'exceptions

Description

bool restore_exception_handler ( void )

restore_exception_handler() est utilisé, après le changement de la fonction de gestion d'exceptions avec la fonction set_exception_handler(), pour revenir à l'ancien gestionnaire d'exceptions (qui peut être la fonction interne ou une fonction définie par l'utilisateur).

Valeurs de retour

Cette fonction retourne toujours TRUE.

Exemples

Exemple #1 Exemple avec restore_exception_handler()

<?php
        
function exception_handler_1(Exception $e)
        {
                echo 
'[' __FUNCTION__ '] ' $e->getMessage();
        }

        function 
exception_handler_2(Exception $e)
        {
                echo 
'[' __FUNCTION__ '] ' $e->getMessage();
        }

        
set_exception_handler('exception_handler_1');
        
set_exception_handler('exception_handler_2');

        
restore_exception_handler();

        throw new 
Exception('Ceci utilise le premier gestionnaire d\'exception...');
?>

L'exemple ci-dessus va afficher :

[exception_handler_1] Ceci utilise le premier gestionnaire d'exception...

Voir aussi



add a note add a note User Contributed Notes
restore_exception_handler
There are no user contributed notes for this page.

set_error_handler> <restore_error_handler
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites