Error[$errno]: $errstr in $errfile at line $errline";
});
set_exception_handler(function($exception) {
error_log("Uncaught Exception: $exception\n");
self::$error_messages[] = "Uncaught Exception: {$exception}";
});
register_shutdown_function(function() use(&$callback) {
if (!self::$error_messages) {
return;
}
ob_end_clean();
http_response_code(500);
header_remove();
$callback(self::$error_messages);
});
}
}