Whats new in PHP 8.4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
php84/libs/autoload.php

11 lines
357 B

<?php
spl_autoload_register(function ($className) {
// Project base directory
$baseDir = dirname(__DIR__,1) . '/';
// Replace namespace separator with directory separator
$file = $baseDir . str_replace('\\', '/', $className) . '.php';
// If the file exists, require it
if (file_exists($file)) {
require_once $file;
}
});