How to catch a fatal error (E_ERROR) in PHP?
Hello everyone! I'm a beginner in PHP and have been struggling with a problem for several days. I have a script that handles file uploads from users. Sometimes, if the file is too large or corrupted, PHP just "crashes" with a fatal error (E_ERROR) — for example, when trying to allocate memory or when calling a non-existent method on an object.
I have already configured `set_error_handler()`, but it does not catch fatal errors. Here is an example code:
```php
nonExistentMethod(); // This will cause E_ERROR
}
processData($userInput);
?>
```
In this case, the script just outputs "Fa
No answers yet.
Log in to leave an answer
Blogs
WebSocket in Rust: Building Real-Time Applications