How should the Model, View, and Controller classes communicate with each other in a PHP application following the MVC pattern?

In a PHP application following the MVC pattern, the Model, View, and Controller classes should communicate with each other through well-defined interfaces. The Controller should handle user input, interact with the Model to retrieve data, and pass the data to the View for presentation. The View should receive data from the Controller and render it for the user. The Model should handle the data storage and retrieval operations independently.

// Controller class
class Controller {
    protected $model;
    protected $view;

    public function __construct(Model $model, View $view) {
        $this->model = $model;
        $this->view = $view;
    }

    public function handleRequest() {
        $data = $this->model->getData();
        $this->view->render($data);
    }
}

// Model class
class Model {
    public function getData() {
        // Retrieve data from the database or any other source
        return $data;
    }
}

// View class
class View {
    public function render($data) {
        // Render the data for presentation
    }
}

// Usage
$model = new Model();
$view = new View();
$controller = new Controller($model, $view);
$controller->handleRequest();