I'm having a bit of trouble understanding how the `restore_exception_handler()` function works in PHP. I've read the documentation, but I'm still unsure about its practical usage and why it would be needed.
To provide some context, I'm currently developing a web application using PHP and I've been working on error handling. My understanding is that PHP already has a default exception handler that is triggered when an exception is thrown and not caught. However, I've come across the `restore_exception_handler()` function, which seems to restore the previous exception handler after setting a custom one.
I'm struggling to grasp why and when I would need to use this function. Can someone please explain the purpose and provide a real-life example where using `restore_exception_handler()` would be beneficial? Additionally, any tips or best practices regarding PHP exception handling would be greatly appreciated.
Thank you in advance for your help!