In my AWS logs, I have entries like this:
[Wed Feb 06 10:12:22.306730 2019] [php7:error] [pid 28445] [client 172.31.10.7:55646] PHP Fatal error: Uncaught Error: Class 'comet_cache' not found in /var/app/current/project-website-wordpress/wp-content/mu-plugins/comet-cache-ec2-enabler.php:41
Those entries are logged when some certain HTTP 500 request happens.
After checking the code, I have found the following (in Line 41 in the file mentioned):
try {
comet_cache::clear();
} catch(Exception $e) {
// if comet cache is not activated, we want to continue anyway
}
This basically makes sense - it seems like the class is not found, but if that were the case, the Exception should be caught in the catch() bloc, and the execution should continue.
Why does PHP crash instead?