PHP restore_exception_handler() fonksiyonu
Örnek
İstisna işleme programını geri yükleme:
<?php // İki kullanıcı tanımlı istisna işleme fonksiyonu function myException1($exception) { echo "[" . __FUNCTION__ . "]" . $exception->getMessage(); } function myException2($exception) { echo "[" . __FUNCTION__ . "]" . $exception->getMessage(); } set_exception_handler("myException1"); set_exception_handler("myException2"); restore_exception_handler(); // İstisna at throw new Exception("Bu, ilk istisna işleme fonksiyonunu tetikler..."); ?>
Yukarıdaki kodun çıktısı şu şekilde benzer olabilir:
[myException1] Bu, ilk istisna işleme fonksiyonunu tetikler...
Tanım ve Kullanım
restore_exception_handler() fonksiyonu önceki istisna işleme programını geri yükler.
set_exception_handler() ile istisna işleme fonksiyonunu değiştirdikten sonra, bu fonksiyon önceki istisna işleme programını geri yüklemek için kullanılabilir.
İpucu:Önceki istisna işleme fonksiyonu yani yerleşik olabilir veya kullanıcı tarafından tanımlanmış olabilir.
Gramer
restore_exception_handler();
Teknik Açıklamalar
Dönüş değeri: | Her zaman TRUE döndürür. |
---|---|
PHP Sürümü: | 5.0+ |