restore_exception_handler

(PHP 5, PHP 7, PHP 8)

restore_exception_handlerBir önceki istisna eylemcisini devreye sokar

Açıklama

restore_exception_handler(): true

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.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

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