restore_exception_handler() ফাংশন পূর্ববর্তী ব্যতিক্রম হ্যান্ডলার পুনরুদ্ধার করে। এটি set_exception_handler() ব্যবহার করে ব্যতিক্রম হ্যান্ডলার ফাংশন পরিবর্তন করার পরে ব্যবহার করা হয়, পূর্ববর্তী ব্যতিক্রম হ্যান্ডলারে প্রত্যাবর্তন করতে (যা বিল্ট-ইন বা ব্যবহারকারীর সংজ্ঞায়িত ফাংশন হতে পারে)।
সিনট্যাক্স
restore_exception_handler()
পরামিতি
- NA
ফেরত
restore_exception_handler() ফাংশন সবসময় TRUE প্রদান করে।
উদাহরণ
নিম্নলিখিত একটি উদাহরণ -
<?php
function customException1($exception) {
echo "[" . __FUNCTION__ . "]" . $exception->getMessage();
}
function customException2($exception) {
echo "[" . __FUNCTION__ . "]" . $exception->getMessage();
}
function customException3($exception) {
echo "[" . __FUNCTION__ . "]" . $exception->getMessage();
}
set_exception_handler("customException1");
set_exception_handler("customException2");
set_exception_handler("customException3");
restore_exception_handler();
// throwing exception
throw new Exception("Triggers the first exception handler!");
?> আউটপুট
নিচের আউটপুট −
[customException1] Triggers the first exception handler!