restore_exception_handler

(PHP 5, PHP 7)

restore_exception_handlerBir önceki istisna eylemcisini devreye sokar

Açıklama

restore_exception_handler ( void ) : bool

set_exception_handler() ile istisna eylemcisini değiştirdikten sonra önceki istisna eylemcisini (yerleşik veya kullanıcı tanımlı bir işlev) devreye sokmak için kullanılır.

Dönen Değerler

Bu işlev daima TRUE döndürür.

Örnekler

Örnek 1 - restore_exception_handler() örneği

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

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

  
set_exception_handler('istisna_eylemci_1');
  
set_exception_handler('istisna_eylemci_2');

  
restore_exception_handler();

  throw new 
Exception('İlk istisna eylemcisi tetiklenir...');
?>

Yukarıdaki örneğin çıktısı:

[istisna_eylemci_1] İlk istisna eylemcisi tetiklenir...

Ayrıca Bakınız