<?php

require __DIR__ . '/../src/functions.php';

spl_autoload_register(function($class) {
    if (strpos($class, 'FastRoute\\') === 0) {
        $dir = strcasecmp(substr($class, -4), 'Test') ? 'src/' : 'test/';
        $name = substr($class, strlen('FastRoute'));
        require __DIR__ . '/../' . $dir . strtr($name, '\\', DIRECTORY_SEPARATOR) . '.php';
    }
});
<?php

require_once __DIR__ . '/../src/functions.php';

spl_autoload_register(function($class) {
    if (strpos($class, 'FastRoute\\') === 0) {
        $dir = strcasecmp(substr($class, -4), 'Test') ? 'src/' : 'test/';
        $name = substr($class, strlen('FastRoute'));
        require __DIR__ . '/../' . $dir . strtr($name, '\\', DIRECTORY_SEPARATOR) . '.php';
    }
});
Change to require_once to prevent a PHP Fatal error during unit tests.
Change to require_once to prevent a PHP Fatal error during unit tests.
