I have been trying to understand the `set_error_handler()` function in PHP, and I'm a little confused about its usage. I have read the documentation, but I would appreciate some practical examples or explanations to help me better understand it.
Could someone give me a clear example of how to use the `set_error_handler()` function in PHP? I think it would be helpful if the example includes the following:
1. The basic syntax and structure of the function.
2. How to define a custom error handler function.
3. How to handle different types of errors, such as warnings, notices, or fatal errors.
I would be really grateful if someone could provide me with some practical code snippets or explanations to clarify things for me. Thank you in advance for your help!