In PHP projects, where is the best practice for storing classes like User and controllers to maintain a clear naming convention?

In PHP projects, it is best practice to organize classes like User and controllers in separate directories to maintain a clear naming convention and improve code organization. By creating dedicated directories for classes and controllers, it becomes easier to locate and manage these components within the project structure.

// Example directory structure:
// /classes/User.php
// /controllers/UserController.php

// Autoload function to load classes dynamically
spl_autoload_register(function($class) {
    $class = str_replace('\\', '/', $class);
    require_once __DIR__ . "/$class.php";
});