What are the advantages of using a centralized kernel file to handle page loading logic in PHP applications?

When developing PHP applications, it can be beneficial to use a centralized kernel file to handle page loading logic. This approach helps to keep the code organized and maintainable by separating the routing and logic from the presentation layer. By using a centralized kernel file, developers can easily manage the application's routes, middleware, and error handling in one central location, improving code readability and scalability.

// index.php

// Include the centralized kernel file
require_once 'kernel.php';

// Run the application
$app->run();