คำอธิบาย
ฟังก์ชัน restore_error_handler() ใช้คืนค่าตัวจัดการข้อผิดพลาดกลับไปเป็นตัวจัดการก่อนหน้า (อาจเป็นตัวจัดการในตัวของ PHP หรือฟังก์ชันผู้ใช้ที่ตั้งค่าไว้ก่อนหน้า)
รูปแบบการใช้งาน (Syntax)
restore_error_handler()
พารามิเตอร์
ไม่มีพารามิเตอร์
ค่าที่คืนกลับ
คืนค่า TRUE เสมอ
ตัวอย่างการใช้งาน
<?php
function unserialize_handler($errno, $errstr) {
echo "Custom error: Invalid hello value.\n";
}
$hello = 'pqrs';
set_error_handler('unserialize_handler');
$original = unserialize($hello);
restore_error_handler();
?>
ผลลัพธ์
Custom error: Invalid hello value.